Exception in CheckDataSource method of Fastline series

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
ML2
Newbie
Newbie
Posts: 2
Joined: Fri Dec 19, 2008 12:00 am

Exception in CheckDataSource method of Fastline series

Post by ML2 » Fri Jan 15, 2010 1:12 pm

Hi
I facing an issue with fastline series CheckDataSource method in WPF build of TeeChart, Build is the UpdateBuild for WPF (and i think it is the latest one)
What i am doing is i want to plot a realtime chart

1 Datatable containing 6 columns
1st col = DateTime value
other 5 col = Double values

this datatable is bound to every series as a datasource and column name is the DataMemeber value.
Values to this datatable are added from a different thread.
Now i have created a UserControl containing a TChart user control.
It has a Timer which periodically calls the methods "CheckDataSource()" of the Fastline series.
This updates the data for the series.

Now for some time the chart runs very well ......
But after some duration i start getting the following exception

An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Data.DataView.ResetRowViewCache()
at System.Data.DataView.UpdateIndex(Boolean force, Boolean fireEvent)
at System.Data.DataView.UpdateIndex(Boolean force)
at System.Data.DataView.SetIndex2(String newSort, DataViewRowState newRowStates, IFilter newRowFilter, Boolean fireEvent)
at System.Data.DataView..ctor(DataTable table)
at Steema.TeeChart.WPF.Styles.Series.Add(DataTable table)
at Steema.TeeChart.WPF.Data.DataSeriesSource.AddTable(Series s, DataTable t)
at Steema.TeeChart.WPF.Data.DataSeriesSource.TryRefreshData(Series s)
at Steema.TeeChart.WPF.Styles.Series.FillFromDataSource()
at Steema.TeeChart.WPF.Styles.Series.CheckDataSource()

Can you please suggest some solution/fix for this problem ?
Also as suggested in another post named "Exception when using "CheckDatasSource()" in real" it is written to use asynchronous painting
by setting the AutoRepaint value to false and use tChart.Refresh method

i did the first part but , i cannot find the Refresh method for the WPF chart control

Regards,

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Exception in CheckDataSource method of Fastline series

Post by Yeray » Tue Jan 19, 2010 2:46 pm

Hi ML2,
ML2 wrote:An item with the same key has already been added.
Could you please check your database and see if the error is appearing always when the same value is going to be added?
ML2 wrote:Also as suggested in another post named "Exception when using "CheckDatasSource()" in real" it is written to use asynchronous painting
by setting the AutoRepaint value to false and use tChart.Refresh method

i did the first part but , i cannot find the Refresh method for the WPF chart control

Code: Select all

tChart1.Invalidate();
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply