Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable Scrolling on the Microsoft Chart Control for Windows Forms

Tags:

c#

mschart

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.

like image 701
Sebas Avatar asked Jul 31 '09 14:07

Sebas


People also ask

How do I add a scroll in Winforms?

Just set the AutoScroll property of your Panel to true and it will handle adding the scrollbars for you. Bear in mind that your controls will need to be anchored to the Top of the Panel to cause Vertical scroll bars automatically, and the Left of the Panel to cause Horizontal scroll bars automatically.

Which property is used to set automatic scrolling to a form?

The AutoScroll property is set to true to display scroll bars on the form to enable the user to scroll to the control.

What is scroll control?

A scroll bar's orientation determines the direction in which scrolling occurs when the user operates the scroll bar. A horizontal scroll bar enables the user to scroll the content of a window to the left or right. A vertical scroll bar enables the user to scroll the content up or down.

What is a scroll chart?

Scroll charts are used to avoid cluttering of plots, thereby providing a clean look. Scroll charts can show a larger number of data plots in a small space. The types of scroll charts available in the FusionCharts Suite XT are : Scroll Column 2D Chart. Scroll Bar 2D Chart.


2 Answers

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.

like image 169
Sebas Avatar answered Sep 30 '22 04:09

Sebas


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.

like image 41
coding_is_fun Avatar answered Sep 30 '22 04:09

coding_is_fun