Microsoft Chart Control Overflow Error After Several Times of Zoom In

Published on Monday, July 18, 2011

If you use Microsoft Chart Control in your Windows Form Application and add the function of zoom in and zoom out, you have to care about the initial and Axis data settings, if you did not set correctly, you might get some errors, the following is the one of multiple errors:

When you zoom in and continue to zoom in several other times, you might got the following error screen:


There are multiple reasons about Microsoft Chart control overflow error. Here we give one case:

In our code, we have some settings for Axis Y:

this.chartArea01.AxisY.ScaleView.SmallScrollMinSize = 0.01;
this.chartArea01.AxisY.ScaleView.SmallScrollSize = 0.01;

We should set a Minimum Size for the Axis Y Scale View:

this.chartArea01.AxisY.ScaleView.MinSize = 0.01;

When we set the value above, the overflow error gone.