[編輯:我提交的問題有關此on the OxyPlot GitHub]麻煩Oxyplot
我有一個WPF窗口一些FunctionSeries一個OxyPlot笛卡兒圖表。當我爲兩個座標軸設置PositionAtZeroCrossing爲真時,出現幾個問題:
1)標題顯示不正確,甚至沒有出現。改變TitlePosition的值似乎沒有改變任何東西。
2)當放大或周圍移動中,x軸推移圖形區域外,如下所示:當PositionAtZeroCrossing沒有被設置爲真
兩個問題不會出現。
我想知道是否有正確的方法來解決這些問題,或解決方法(我不熟悉OxyPlot)。
//My PlotModel is binded to the Model of a PlotView in my WPF control.
//FonctionQlimPlim, maxX, maxY, minX and maxY are defined elsewhere
PlotModel plot = new PlotModel()
{
PlotType = PlotType.Cartesian
};
plot.Axes.Add(new LinearAxis()
{
Position = AxisPosition.Bottom,
Minimum = minX,
Maximum = maxX,
Title = "Q (kVAR)",
PositionAtZeroCrossing = true
});
plot.Axes.Add(new LinearAxis()
{
Position = AxisPosition.Left,
Minimum = minY,
Maximum = maxY,
Title = "P (kW)",
PositionAtZeroCrossing = true
});
//One of the FunctionSeries
var f = FonctionQlimPlim;
f.Color = OxyColors.Red;
plot.Series.Add(f);
謝謝。我試圖做的是最初讓我的Y軸位於圖形中心的x = 0處(最小/最大值是爲此計算的),如果不是針對這些問題,「PositionAtZeroCrossing」會很好地完成這個技巧。 當爲Y軸激活該選項時,在y = 0時,X軸在圖的外部和2d線與Y軸相交。這是第2條線和Y軸,當在圖的外部用0縮放時,Y軸超出圖。在我的情況下,這非常明顯,因爲圖形不是窗口中唯一的元素。看起來越野車,我可能不得不放棄0橫軸。 – cmousset 2014-09-19 13:00:07
我還注意到,在你的例子中,當'PositionAtZeroCrossing'爲true時,Y標題也不會出現。有關爲什麼或如何放置它的任何想法? – cmousset 2014-09-19 13:02:32
不......真的不知道...你可能想要放棄開發者的一條線,或者看看源代碼:) – Noctis 2014-09-19 13:51:11