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,
Exception in CheckDataSource method of Fastline series
Re: Exception in CheckDataSource method of Fastline series
Hi ML2,
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:An item with the same key has already been 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,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |