MSCHart X 轴值显示错误
我有一个 MSChart,它接受一系列数据元素
foreach(Int16 element in data)
{
this.view.chart.Series["Series1"].Points.AddXY((double)i/100, (double) element/41);
}
this.view.chart.ChartAreas[0].AxisX.Mimimum=0;
this.view.chart.ChartAreas[0].AxisX.Interval = 1;
this.view.chart.ChartAreas[0].AxisX.ScaleView.Zoom(0,10);
this.view.chart.ChartAreas[0].AxisX.ScaleView.SmallScrollSize = 10;
,它会在 10 秒帧内查看图表,因此应该从 0 - 10,然后 10 到 20,等等。 现在奇怪的是,当我第一次启动图表时,它正确显示了 0 到 10 时间范围内的数据。但是当我点击向前滚动到下一个 10 秒帧时,它显示 9.994 到 19.994,然后是 19.994 到29.994。
现在,如果我一直滚动回到开头(即 0 前 10 名),然后再次向前滚动,它就可以了!从 0 - 10、10 - 20、20 - 30 开始,但是当我到达图表末尾时,ot 又回到了令人讨厌的双值(例如 69.994):S
我真的不明白为什么会发生这种情况,有人可以帮助我吗请
附注。这是折线图而不是条形图
I havs an MSChart which takes in a series of data elements
foreach(Int16 element in data)
{
this.view.chart.Series["Series1"].Points.AddXY((double)i/100, (double) element/41);
}
this.view.chart.ChartAreas[0].AxisX.Mimimum=0;
this.view.chart.ChartAreas[0].AxisX.Interval = 1;
this.view.chart.ChartAreas[0].AxisX.ScaleView.Zoom(0,10);
this.view.chart.ChartAreas[0].AxisX.ScaleView.SmallScrollSize = 10;
This views the the chart in 10 second frames, so this should go from 0 - 10, then 10 to 20, etc.
Now the strange thing is, when I first launch the chart, it correctly shows the data within the time frame 0 to 10. BUT when I fist click to scroll forward to the next 10 second frame, it shows 9.994 to 19.994, then 19.994 to 29.994.
Now, if I scroll all the way back to the start (i.e. 0 top 10) and then scroll forward again it WORKS! goes from 0 - 10, 10 - 20, 20 - 30 but when I reach the end of my chart ot goes back into the annoying double value (e.g. 69.994) :S
I really cant figure out why this is happening, could anyone help me please
PS. This is a line chart not a bar chart
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
LabelStyle.Format
来显示标签。than you can use
LabelStyle.Format
for displaying labels.