Search code examples
.netscrollmschartzoomingdundas

How to really scroll and zoom a MS Chart controls?


I am doing a trending application with the MS Chart controls 4.

I integrated zoom and scroll with the mouse wheel and the right button, which gives the control a unusual smoothness.

However, I relealize that the ChartArea.Axis methods ScaleView.Scroll and ScaleView.Zoom does actually not zooms nor scrolls the grid, the labels and the striplines.

Instead, it zooms and scrolls the point series but keeps the grids labels as is, and only adjusts the label values.

For example, if I want to scroll this sample chart to the right :

enter image description here

I have this.

enter image description here

Basically, this is what I want to achieve :

enter image description here

How can I achieve a real scrolling and zooming with the MS Chart controls ?

EDIT: I managed to get the wanted behavior by setting the X value to DateTimes. However, I would like to use doubles on the X axis.


Solution

  • It seems that this behavior is by design : only DateTime type axis values allows my chart to be scrolled smoothly.