的WinForms图表控件自动滚屏 [英] WinForms Chart Control autoscroll

查看:101
本文介绍了的WinForms图表控件自动滚屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一间酒吧的图形在一个图表控件在我的应用程序。我给自己定的属性,因为这code显示:

I've got a bar's graphic in a chart control in my app. I've set the properties as this code shows:

Chart1.ChartAreas("ChartArea1").AxisX.ScrollBar.Enabled = True
Chart1.ChartAreas("ChartArea1").AxisX.IsLabelAutoFit = True
Chart1.ChartAreas("ChartArea1").AxisX.ScaleView.Size = 40

我这样做,becaus我想修复列的宽度,使40列可以看到。然后(在第40 COLS)滚动自动显示。

I did that becaus I wanted to fix the columns width so that 40 columns can be seen. Then (over the 40 first cols) a scroll is automatically shown.

我想知道我该怎么做才能使该滚动总是在右边。因此可见的列总是在过去的40。

I want to know how can I do to make that scroll be always on the right. So that the visible columns be always the last 40.

谢谢!

迭戈

修改

我复制了code以上从这里开始: <一href="http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/40a9646a-fbf1-47d1-85e4-47bc9108a3eb" rel="nofollow">http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/40a9646a-fbf1-47d1-85e4-47bc9108a3eb

I copied the code above from here: http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/40a9646a-fbf1-47d1-85e4-47bc9108a3eb

推荐答案

我已经找到了:每次我添加了一个新的起点,我必须运行此code:

I've found out: each time I add a new point I must run this code:

if (chrGraficos.ChartAreas[0].AxisX.Maximum > chrGraficos.ChartAreas[0].AxisX.ScaleView.Size)
    chrGraficos.ChartAreas[0].AxisX.ScaleView.Scroll(chrGraficos.ChartAreas[0].AxisX.Maximum);

这篇关于的WinForms图表控件自动滚屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆