locked
Unhandled Overflow exception after zooming RRS feed

  • General discussion

  • Hello,

    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)
           at System.Drawing.Graphics.DrawLine(Pen pen, Single x1, Single y1, Single x2, Single y2)
           at System.Windows.Forms.DataVisualization.Charting.GdiGraphics.DrawLine(Pen pen, Single x1, Single y1, Single x2, Single y2)
           at System.Windows.Forms.DataVisualization.Charting.ChartGraphics.DrawLine(Pen pen, Single x1, Single y1, Single x2, Single y2)
           at System.Windows.Forms.DataVisualization.Charting.ChartTypes.FastLineChart.DrawLine(Series series, DataPoint point, DataPoint pointMin, DataPoint pointMax, Int32 pointIndex, Pen pen, Single firstPointX, Single firstPointY, Single secondPointX, Single secondPointY)
           at System.Windows.Forms.DataVisualization.Charting.ChartTypes.FastLineChart.Paint(ChartGraphics graph, CommonElements common, ChartArea area, Series seriesToDraw)
           at System.Windows.Forms.DataVisualization.Charting.ChartArea.Paint(ChartGraphics graph)
           at System.Windows.Forms.DataVisualization.Charting.ChartPicture.Paint(Graphics graph, Boolean paintTopLevelElementOnly)
           at System.Windows.Forms.DataVisualization.Charting.Chart.OnPaint(PaintEventArgs e)
           at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
           at System.Windows.Forms.Control.WmPaint(Message& m)
           at System.Windows.Forms.Control.WndProc(Message& m)
           at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
           at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
           at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
           at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
           at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
           at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
           at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
           at System.Windows.Forms.Application.Run(Form mainForm)
           at InternInstr.Program.Main() in C:\Garretts_Data\Software\Active\InternInstr\InternInstr\Program.cs:line 21
      InnerException: 


    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.

    Tuesday, September 29, 2009 7:33 PM

All replies

  • Well this looks pretty hopeless since no admins have replied in about a year, but I'm getting the same exception. Any chance of a solution?

    Thursday, July 22, 2010 4:32 PM
  • Bump. Is there any official support for the chart controls?
    Wednesday, July 28, 2010 12:17 AM
  • Bump.
    Thursday, August 19, 2010 4:01 PM
  • Disappointing, isn't it?

    On the other hand, when posting this reply MS was thoughtful enough to ask if I really wanted to send what was soon to be on a public forum over an unencrypted line...

    The exception helper indicates that this problem is in System.Drawing.dll, but that doesn't tell us how to avoid it, other than "don't zoom". It seems to occur more readily (in my case) when the range of  x data is small. Any other clues?

     

     

    Wednesday, September 29, 2010 11:44 PM