首先我XAMLWPF工具包數據可視化 - 如何在代碼背後設置間隔,最小值和最大值?
<charting:Chart x:Name="ChartMain" />
這裏是我的代碼背後:
List<KeyValuePair<string, int>> valueList1 = new List<KeyValuePair<string, int>>();
valueList1.Insert(0, new KeyValuePair<string, int>(DateTime.Now.ToString(), 1));
LineSeries lineSeries1 = new LineSeries();
lineSeries1.Title = "Eins";
lineSeries1.DependentValuePath = "Value";
lineSeries1.IndependentValuePath = "Key";
lineSeries1.ItemsSource = valueList1;
ChartMain.Series.Add(lineSeries1);
我的問題:如何設置的最小/最大和時間間隔在後面的代碼?
看看'ChartMain.Axes'。你看到該集合中有任何可用的軸? – jsanalytics
是的,我願意。示例: \t \t \t LinearAxis lx = new LinearAxis(); \t \t \t lx.Minimum = -1; \t \t \t lx.Maximum = +1; \t \t \t lx.Interval = 0.5; \t \t \t ChartMain.Axes.Add(lx); 但編譯後我無法看到圖表上的ist ... – MeerArtefakt
哦,對不起,一行丟失: lx.Orientation = AxisOrientation.Y; 現在它可以正常工作 - 我感謝你! – MeerArtefakt