Exception in CheckDataSource method of Fastline series
Posted: 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,
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,