Enable Scrolling on the Microsoft Chart Control fo

2019-01-15 18:27发布

I understand that

Scrollbars are only shown when zooming occurs. In other words, even if a scrollbar is enabled, it will only be visible when a view is being displayed.

but then, how do I enable zooming on the Chart Control. I am looking to do this in order to avoid having my Axis-Lables break into two columns after a certain number of values are added to the graph.

标签: c# mschart
2条回答
仙女界的扛把子
2楼-- · 2019-01-15 18:52

Maybe this will help.

Click the chart in the design view.

Under properties choose: Chart Area (collections) it is the [...] button

That brings up a bunch the ChartArea Collections Editor.

Scroll down to the CursorX (x is the horizontal)and switch IsUserEnabled to TRUE and IsUserSelection to TRUE

Then you can click and drag areas of the chart on the horizontal axis to 'zoom' in.

There might be a more intuitive way to do all this but it worked.

Good luck.

查看更多
混吃等死
3楼-- · 2019-01-15 18:55

ok, this explains it: http://msdn.microsoft.com/en-us/library/dd456730.aspx

In the Chart control for Windows Forms, you can give the chart viewer the flexibility to zoom and scroll the data view by enabling cursors and selections. To do this, use the CursorX and CursorY properties.

You can enable cursors, zooming, and scrolling for the X or Y axes, or both. To enable the cursor in the data view, set the IsUserEnabled property to True. To enable data view selection, use the IsUserSelectionEnabled property to True. Zooming and Scrolling

By default, zooming and scrolling are enabled when you enable data view selection. Use the ScaleView and ScrollBar properties in the chart area's X or Y axis to adjust the look and feel of the scroll bar when it is shown.

To disable zooming, use the Zoomable property found in the respective axis' ScaleView object. To disable scrolling, use the Enabled property found in the respective axis' ScrollBar object.

查看更多
登录 后发表回答