【发布时间】:2015-11-28 15:17:12
【问题描述】:
首先是我的 xaml
<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。您在该集合中看到任何可用的轴吗? -
是的,我愿意。示例:LinearAxis lx = new LinearAxis(); lx.最小值 = -1; lx.最大值 = +1; lx.Interval = 0.5; ChartMain.Axes.Add(lx);但是编译后我在 Chart 上看不到 ist...
-
哦,对不起,少了一行:lx.Orientation = AxisOrientation.Y;现在它可以工作了,很好——谢谢!
标签: c# wpf charts wpftoolkit