I have problems with a Points series that has dates on the X axis, doubles on the Y. The series is bound to a data view.
The chart including the series is on a page where a button allows the user to select a filter that can be applied to filter the points displayed. If the selected filter causes the dataview to return no values, an IndexOutOfRangeException is raised. The stack trace is as follows:
Exception: IndexOutOfRangeException
Message: Index was outside the bounds of the array.
Stacktrace:
at Steema.TeeChart.Styles.Series.CalcXPos(Int32 index)
at Steema.TeeChart.Styles.CustomPoint.CalcXPos(Int32 valueIndex)
at Steema.TeeChart.Styles.CustomPoint.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.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
What can I do to stop this exception being raised. Any help much appreciated.
Thanks,
Liviu Zaharia
problems with Points
Hi.
A quick and dirty solution is to set series Active property to false if there is no data. You can do this right after you apply the filter and before series is populated with data (in this case no data).
A quick and dirty solution is to set series Active property to false if there is no data. You can do this right after you apply the filter and before series is populated with data (in this case no data).
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
Hi,
It seems to work, the only downside to this fix is that by making the series inactive, it becomes unticked in the legend, which is not desirable. Any other suggestions?
On the other hand I have another issue. If I have several series displayed in the chart, all with the same Z-order and the chart has multiple pages, only one series is displayed(if the chart has one page only all the series are displayed properly).
Is any of this issues likely to be fixed in the near future?
Regards,
Liviu
It seems to work, the only downside to this fix is that by making the series inactive, it becomes unticked in the legend, which is not desirable. Any other suggestions?
On the other hand I have another issue. If I have several series displayed in the chart, all with the same Z-order and the chart has multiple pages, only one series is displayed(if the chart has one page only all the series are displayed properly).
Is any of this issues likely to be fixed in the near future?
Regards,
Liviu
Hi,
Maybe you can create a 'fake' series with the same name and color to show it in the Legend ?It seems to work, the only downside to this fix is that by making the series inactive, it becomes unticked in the legend, which is not desirable. Any other suggestions?
Yes, you're correct, this is a bug which has been added on our defect list.On the other hand I have another issue. If I have several series displayed in the chart, all with the same Z-order and the chart has multiple pages, only one series is displayed(if the chart has one page only all the series are displayed properly).
Yes, of course. We'll try to fix all of them for the next maintenance releases.Is any of this issues likely to be fixed in the near future?
Pep Jorge
http://support.steema.com
http://support.steema.com