Exception with Pie Chart with no data
Posted: Wed Nov 05, 2008 1:17 pm
Hi
I have a pie chart with a MarksTip and with one series however there is no data in the series ( Chart.Series[0].Count == 0 ) . When displaying it
I get the title with nothing displayed in the graph area. That is OK.
HOWEVER When the mouse is on the empty graph area I get an exception . I removed the marks tip from my code but then got a second exception .
See both exceptions below
EXCEPTION With MarksTip
System.NullReferenceException: Object reference not set to an instance of an object.
at Steema.TeeChart.Styles.Pie.CalcClickedPie(Int32 x, Int32 y)
at Steema.TeeChart.Styles.Pie.Clicked(Int32 x, Int32 y)
at Steema.TeeChart.Tools.MarksTip.FindClickedSeries(Int32 x, Int32 y, Int32& index)
at Steema.TeeChart.Tools.MarksTip.MouseEvent(MouseEventKinds kind, MouseEventArgs e, Cursor& c)
at Steema.TeeChart.Chart.BroadcastMouseEvent(MouseEventKinds kind, MouseEventArgs e, Cursor& c)
at Steema.TeeChart.Chart.BroadcastMouseEvent(MouseEventKinds kind, MouseEventArgs e)
at Steema.TeeChart.TChart.OnMouseMove(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseMove(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.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
EXCEPTION without MarksTip
reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
at Steema.TeeChart.Styles.Pie.CalcClickedPie(Int32 x, Int32 y)
at Steema.TeeChart.Styles.Pie.Clicked(Int32 x, Int32 y)
at Steema.TeeChart.Styles.Series.CheckMouse(Cursor& c, Int32 x, Int32 y)
at Steema.TeeChart.Chart.CheckMouseSeries(Cursor& c, Int32 X, Int32 Y)
at Steema.TeeChart.Chart.DoMouseMove(Int32 x, Int32 y, Cursor& c)
at Steema.TeeChart.TChart.OnMouseMove(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseMove(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.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Please help me avoid getting an exception when mouse hovers over graph area.
Thanks.
I have a pie chart with a MarksTip and with one series however there is no data in the series ( Chart.Series[0].Count == 0 ) . When displaying it
I get the title with nothing displayed in the graph area. That is OK.
HOWEVER When the mouse is on the empty graph area I get an exception . I removed the marks tip from my code but then got a second exception .
See both exceptions below
EXCEPTION With MarksTip
System.NullReferenceException: Object reference not set to an instance of an object.
at Steema.TeeChart.Styles.Pie.CalcClickedPie(Int32 x, Int32 y)
at Steema.TeeChart.Styles.Pie.Clicked(Int32 x, Int32 y)
at Steema.TeeChart.Tools.MarksTip.FindClickedSeries(Int32 x, Int32 y, Int32& index)
at Steema.TeeChart.Tools.MarksTip.MouseEvent(MouseEventKinds kind, MouseEventArgs e, Cursor& c)
at Steema.TeeChart.Chart.BroadcastMouseEvent(MouseEventKinds kind, MouseEventArgs e, Cursor& c)
at Steema.TeeChart.Chart.BroadcastMouseEvent(MouseEventKinds kind, MouseEventArgs e)
at Steema.TeeChart.TChart.OnMouseMove(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseMove(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.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
EXCEPTION without MarksTip
reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
at Steema.TeeChart.Styles.Pie.CalcClickedPie(Int32 x, Int32 y)
at Steema.TeeChart.Styles.Pie.Clicked(Int32 x, Int32 y)
at Steema.TeeChart.Styles.Series.CheckMouse(Cursor& c, Int32 x, Int32 y)
at Steema.TeeChart.Chart.CheckMouseSeries(Cursor& c, Int32 X, Int32 Y)
at Steema.TeeChart.Chart.DoMouseMove(Int32 x, Int32 y, Cursor& c)
at Steema.TeeChart.TChart.OnMouseMove(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseMove(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.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Please help me avoid getting an exception when mouse hovers over graph area.
Thanks.