MS Chart Control Zoom MinSize issue

itsmatt picture itsmatt · Oct 26, 2009 · Viewed 7.8k times · Source

I'm implementing a scatter plot using the MS Chart Control .NET 3.5, WinForms, C#. My x-axis data is DateTime and noticed I couldn't zoom in smaller than a resolution of 1 day, despite setting the ScaleView as follows:

chart1.ChartAreas["MyChart"].AxisX.ScaleView.MinSize = 4;
chart1.ChartAreas["MyChart"].AxisX.ScaleView.MinSizeType = DateTimeIntervalType.Hours;

Has anyone else had this issue? Any ideas?

Answer

itsmatt picture itsmatt · Oct 29, 2009

Figured this out... perhaps I didn't RTFM close enough, but it wasn't obvious from the interactive demo.

Set

chart1.ChartAreas["MyChart"].CursorX.Interval = 0;

and then it allowed me to zoom along the x-axis just fine.