problems with Points

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
liviu
Newbie
Newbie
Posts: 7
Joined: Tue Apr 08, 2003 4:00 am

problems with Points

Post by liviu » Thu Aug 05, 2004 2:01 pm

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

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Fri Aug 06, 2004 6:13 am

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).
Marjan Slatinek,
http://www.steema.com

liviu
Newbie
Newbie
Posts: 7
Joined: Tue Apr 08, 2003 4:00 am

Post by liviu » Fri Aug 06, 2004 9:51 am

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

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Aug 09, 2004 8:03 am

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?
Maybe you can create a 'fake' series with the same name and color to show it in the Legend ?
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, you're correct, this is a bug which has been added on our defect list.
Is any of this issues likely to be fixed in the near future?
Yes, of course. We'll try to fix all of them for the next maintenance releases.

Post Reply