This is a migrated thread and some comments may be shown as answers.

Exception at RadChart when adding new item

1 Answer 69 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Leticia
Top achievements
Rank 1
Leticia asked on 25 Apr 2016, 08:27 PM

Hi Team!

I'm having the following exception throwed sometimes (I can't reproduce it consistently).

Is this a bug? 

System.ArgumentException: 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 Telerik.Windows.Controls.Charting.ResourceHelper.GetThemeLocationAttribute(Theme theme)
   at Telerik.Windows.Controls.Charting.ResourceHelper.RetrieveAnimationStoryboard(IAnimatable animatableItem)
   at Telerik.Windows.Controls.Charting.SelfDrawingSeries.ManageAnimationSettings()
   at Telerik.Windows.Controls.Charting.SelfDrawingSeries.OnApplyTemplate()
   at System.Windows.FrameworkElement.ApplyTemplate()
   at Telerik.Windows.Controls.ItemsControlExtensions.GetItemsPanelRecursive[TPanel](DependencyObject control)
   at Telerik.Windows.Controls.Charting.ItemsControlExtensions.InvalidateItemsPanelMeasureRecursive(ItemsControl control)
   at Telerik.Windows.Controls.Charting.ChartArea.InvalidateSeriesMeasure()
   at Telerik.Windows.Controls.Charting.Axis.UpdateRangeAndStep()
   at Telerik.Windows.Controls.Charting.Axis.BuildAxisData()
   at Telerik.Windows.Controls.Charting.AxisX.BuildAxisData()
   at Telerik.Windows.Controls.Charting.Axis.UpdateAxis()
   at Telerik.Windows.Controls.Charting.Axis.ChartAreaDataChanged(Object sender, EventArgs e)
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at Telerik.Windows.Controls.Charting.ChartArea.OnDataChanged()
   at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
   at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.RadObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.RadObservableCollection`1.RaiseCollectionChangedOnResume()
   at Telerik.Windows.Data.RadObservableCollection`1.ResumeNotifications()
   at Telerik.Windows.Data.RadObservableCollection`1.AddRange(IEnumerable`1 items)
   at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.AddRange(IEnumerable`1 items)
   at Telerik.Windows.Controls.RadChart.GenerateDataSeries(Object originalData, SeriesMappingCollection seriesMappings, ChartArea chartArea)
   at Telerik.Windows.Controls.RadChart.GenerateDataSeries(Object originalData)
   at Telerik.Windows.Controls.RadChart.Rebind(Object originalData)
   at Telerik.Windows.Controls.RadChart.NotifyCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
   at System.Collections.ObjectModel.Collection`1.Add(T item)
   at MTB.View.OptionWatchContent.InsertRow(MTuple row)
   at MTB.View.OptionWatchContent.<ResetPlot>b__16()
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

 

Thanks a lot!

Best regards,

1 Answer, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 27 Apr 2016, 08:16 AM
Hello Leticia,

We cannot confirm whether or not this is a bug unless we have a project that demonstrates this. We cannot get all the information we need just from a stack trace. If you need further assistance with this, I will ask that you provide us with a small working project that reproduces the error, so that we can take a look.

As I mentioned in another ticket of yours earlier today, we suggest you do not use the old RadChart for new development, but use the new RadChartView.

Regards,
Petar Marchev
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
Chart
Asked by
Leticia
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Share this question
or