views:

12

answers:

0

This Question has been languishing un-answered on the MSChart forum for over a year.

I'm continually getting an overflow exception on a chart. I'm setting up my chart as follows:

InstrChart.Legends.Clear();
dataArea = InstrChart.ChartAreas.Add("Instr1");
dataArea.AxisX.MajorGrid.Enabled = false;
dataArea.AxisY.MajorGrid.Enabled = false;
dataArea.CursorX.IsUserSelectionEnabled = true;

I'm then adding 12 series with about 10000 points each.

The exception occurs when I zoom down to show only 3 or 4 point per series. Immediately after I release the mouse button for a zoom I get the following exception:

System.OverflowException was caught   
  Message="Overflow error."   
  Source="System.Drawing"   
  StackTrace:   
     at System.Drawing.Graphics.CheckErrorStatus(Int32 status)   

(etc - see link above for full trace.)

I've removed all event handler for the chart with no luck in stopping zooming from eventuall causing this exception. I've set IsUserSelectionEnabled to false for the chart and done zooming from code with no luck.

Any help on this issue would be great. Cheers.

This exception appears to occur anytime you zoom down "too far" (the meaning of which may vary), regardless of how the rest of the chart is configured. Several people have reported this issue. The exception helper indicates that it's in System.Drawing.dll.

Anyone here have any clues or workarounds?