Chart series problem

Hi,
I'm getting error when I try to add series to a chart.
I need to remove old series and add new one each time data is updated.

Here below my code:

ColumnSeries scoreColumnSerie = new ColumnSeries();
scoreColumnSerie.ItemsSource = chartSource;
scoreColumnSerie.XBindingPath = "Date";
scoreColumnSerie.YBindingPath = "Score";
scoreColumnSerie.Color = Color.Gray;
scoreColumnSerie.Spacing = 1;
SplineSeries scoreSplineSerie = new SplineSeries();
scoreSplineSerie.ItemsSource = chartSource;
scoreSplineSerie.XBindingPath = "Date";
scoreSplineSerie.YBindingPath = "Score";
scoreSplineSerie.Color = Color.Red;
foreach (var item in scoreChart.Series)
{
item.IsVisible = false;
}
scoreChart.Series.Add(scoreColumnSerie);
scoreChart.Series.Add(scoreSplineSerie);

I'm getting this exception

at System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) [0x00029] in <3509a158db3d4f54948bb45b5c96d480>:0
at System.Collections.ObjectModel.Collection`1[T].Insert (System.Int32 index, T item) [0x00026] in <3509a158db3d4f54948bb45b5c96d480>:0
at Syncfusion.SfChart.XForms.Droid.SfChartMapping.OnSeriesCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00067] in :0
at (wrapper delegate-invoke) :invoke_void_object_NotifyCollectionChangedEventArgs (object,System.Collections.Specialized.NotifyCollectionChangedEventArgs)
at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0000f] in <8166b2440f0244908390599cc5ef26df>:0
at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00009] in <8166b2440f0244908390599cc5ef26df>:0
at System.Collections.ObjectModel.ObservableCollection`1[T].InsertItem (System.Int32 index, T item) [0x00024] in <8166b2440f0244908390599cc5ef26df>:0
at System.Collections.ObjectModel.Collection`1[T].Add (T item) [0x00020] in <3509a158db3d4f54948bb45b5c96d480>:0


I'm using the latest version.

Regards,

10 Replies

SS Sayed Seliman November 26, 2017 03:27 PM UTC

Any idea?

Thanks


LR Lakshmi Radha Krishnan Syncfusion Team November 26, 2017 03:53 PM UTC

Hi Sayed, 
 
Thanks for using Syncfusion products.

            We were unable to reproduce the reported issue at our end and we have prepared the sample for this. Please update us the modified sample or chart related code snippet to reproduce the issue which will be helpful for providing further assistance on this.  

Regards,
Lakshmi R.
 



SS Sayed Seliman November 29, 2017 12:18 AM UTC

Dear Sir,

I'm countinuosly getting this error, it's hard to replicate in your example.
I'm just adding data to a series and then need to remove oldest one and add newest.

Sometimes I'm getting this error stack

System.ObjectDisposedException: Cannot access a disposed object.
11-29 01:12:04.264 I/MonoDroid(31197): Object name: 'Syncfusion.SfChart.XForms.Droid.SfChartExt'.
11-29 01:12:04.264 I/MonoDroid(31197):   at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in <4db1a0301fa449c78322331bbfc646ac>:0 
11-29 01:12:04.264 I/MonoDroid(31197):   at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in <4db1a0301fa449c78322331bbfc646ac>:0 
11-29 01:12:04.264 I/MonoDroid(31197):   at Android.Views.View.get_Context () [0x0000a] in <945dbb23fe174de98cdcdac42a3403c9>:0 
11-29 01:12:04.264 I/MonoDroid(31197):   at Com.Syncfusion.Charts.ChartSeries.OnAttachDataMarkerRenderer () [0x00049] in <ac042e9d150f49dfb7da17f1fe7f97ae>:0 
11-29 01:12:04.264 I/MonoDroid(31197):   at Com.Syncfusion.Charts.ChartBase.AddSeries (Com.Syncfusion.Charts.ChartSeries chartSeries) [0x00019] in <ac042e9d150f49dfb7da17f1fe7f97ae>:0 
11-29 01:12:04.264 I/MonoDroid(31197):   at Com.Syncfusion.Charts.ChartBase.Series_CollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00038] in <ac042e9d150f49dfb7da17f1fe7f97ae>:0 
11-29 01:12:04.264 I/MonoDroid(31197):   at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0000f] in <1afa693aa58f46e5a35d92289a408a0d>:0 
11-29 01:12:04.264 I/MonoDroid(31197):   at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00009] in <1afa693aa58f46e5a35d92289a408a0d>:0 
11-29 01:12:04.264 I/MonoDroid(31197):   at System.Collections.ObjectModel.ObservableCollection`1[T].InsertItem (System.Int32 index, T item) [0x00024] in <1afa693aa58f46e5a35d92289a408a0d>:0 
11-29 01:12:04.264 I/MonoDroid(31197):   at System.Collections.ObjectModel.Collection`1[T].Insert (System.Int32 index, T item) [0x0002f] in <971826ad937341c8af4968f422a0c747>:0 
11-29 01:12:04.264 I/MonoDroid(31197):   at Syncfusion.SfChart.XForms.Droid.SfChartMapping.OnSeriesCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00067] in <ac042e9d150f49dfb7da17f1fe7f97ae>:0 
11-29 01:12:04.264 I/MonoDroid(31197):   at (wrapper delegate-invoke) <Module>:invoke_void_object_NotifyCollectionChangedEventArgs (object,System.Collections.Specialized.NotifyCollectionChangedEventArgs)
11-29 01:12:04.264 I/MonoDroid(31197):   at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0000f] in <1afa693aa58f46e5a35d92289a408a0d>:0 
11-29 01:12:04.264 I/MonoDroid(31197):   at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00009] in <1afa693aa58f46e5a35d92289a408a0d>:0 
11-29 01:12:04.264 I/MonoDroid(31197):   at System.Collections.ObjectModel.ObservableCollection`1[T].InsertItem (System.Int32 index, T item) [0x00024] in <1afa693aa58f46e5a35d92289a408a0d>:0 
11-29 01:12:04.264 I/MonoDroid(31197):   at System.Collections.ObjectModel.Collection`1[T].Add (T item) [0x00020] in <971826ad937341c8af4968f422a0c747>:0 

What does it mean?
Why I'm getting this error sometime yes and others no?

Please help me
Regards


SS Sayed Seliman November 29, 2017 02:58 PM UTC

Any news?

Regards,


LR Lakshmi Radha Krishnan Syncfusion Team November 30, 2017 04:14 AM UTC

Hi Sayed,  
 
We have analyzed the reported problem and can able to reproduce the issue at our end. The support incident to track the status of this problem has been created under your account. Please log on to our support website to check for further updates. 
 
 
Regards, 
Lakshmi R. 



SS Sayed Seliman replied to Lakshmi Radha Krishnan December 12, 2017 11:33 AM UTC

Hi Sayed,  
 
We have analyzed the reported problem and can able to reproduce the issue at our end. The support incident to track the status of this problem has been created under your account. Please log on to our support website to check for further updates. 
 
 
Regards, 
Lakshmi R. 


Dear Sir,

we have updated the library but now we are getting new errors while trying to add 
The stack exception is

The thread 'Unknown' (0x7) has exited with code 0 (0x0).
[0:] System.NullReferenceException: Object reference not set to an instance of an object.
  at Com.Syncfusion.Charts.ChartSeries.OnAttachDataMarkerRenderer () [0x00006] in <901eb7cca29a439d95766247d2aa18c4>:0 
  at Com.Syncfusion.Charts.ChartDataMarker.set_ShowLabel (System.Boolean value) [0x00027] in <901eb7cca29a439d95766247d2aa18c4>:0 
  at Syncfusion.SfChart.XForms.Droid.ChartSeriesMapping.ResetDataMarkerValues (Com.Syncfusion.Charts.ChartDataMarker nativeDataMarker, System.Boolean isNew) [0x00007] in <901eb7cca29a439d95766247d2aa18c4>:0 
  at Syncfusion.SfChart.XForms.Droid.ChartSeriesMapping.OnChartSeriesPropertiesChanged (System.String propertyName, Syncfusion.SfChart.XForms.ChartSeries formSeries, Com.Syncfusion.Charts.ChartSeries nativeSeries) [0x000cc] in <901eb7cca29a439d95766247d2aa18c4>:0 
  at Syncfusion.SfChart.XForms.Droid.ChartSeriesMapping.OnCartesianSeriesPropertiesChanged (System.String propertyName, Syncfusion.SfChart.XForms.CartesianSeries formSeries, Com.Syncfusion.Charts.CartesianSeries nativeSeries) [0x0008b] in <901eb7cca29a439d95766247d2aa18c4>:0 
  at Syncfusion.SfChart.XForms.Droid.ChartSeriesMapping.OnXyDataSeriesPropertiesChanged (System.String propertyName, Syncfusion.SfChart.XForms.XyDataSeries formSeries, Com.Syncfusion.Charts.XyDataSeries nativeSeries) [0x0001f] in <901eb7cca29a439d95766247d2aa18c4>:0 
  at Syncfusion.SfChart.XForms.Droid.ChartSeriesMapping.OnLineSeriesPropertiesChanged (System.String propertyName, Syncfusion.SfChart.XForms.LineSeries formSeries, Com.Syncfusion.Charts.LineSeries nativeSeries) [0x00000] in <901eb7cca29a439d95766247d2aa18c4>:0 
  at Syncfusion.SfChart.XForms.Droid.ChartSeriesMapping.GetNativeSeries (Syncfusion.SfChart.XForms.ChartSeries chartSeries) [0x0032c] in <901eb7cca29a439d95766247d2aa18c4>:0 
  at Syncfusion.SfChart.XForms.Droid.SfChartMapping.OnSeriesCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0005d] in <901eb7cca29a439d95766247d2aa18c4>:0 
  at (wrapper delegate-invoke) <Module>:invoke_void_object_NotifyCollectionChangedEventArgs (object,System.Collections.Specialized.NotifyCollectionChangedEventArgs)
  at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0000f] in <a43c208267f442c0b1c116459df743b9>:0 
  at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00009] in <a43c208267f442c0b1c116459df743b9>:0 
  at System.Collections.ObjectModel.ObservableCollection`1[T].InsertItem (System.Int32 index, T item) [0x00024] in <a43c208267f442c0b1c116459df743b9>:0 
  at System.Collections.ObjectModel.Collection`1[T].Add (T item) [0x00020] in <db530c8c100743749ca5744cc7d175e2>:0 

Regards


SS Sayed Seliman December 13, 2017 03:31 PM UTC

Hi,

do you have any news?

Regards,


DV Divya Venkatesan Syncfusion Team December 13, 2017 03:59 PM UTC

Hi Sayed,

We have analyzed the reported problem and can able to reproduce the issue at our end. Please log on to our support website to track the status of this problem which is created under your account.

Link: https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents/   

Regards,
Divya Venkatesan 



UM uma replied to Sayed Seliman January 15, 2018 02:42 AM UTC

Hi,

do you have any news?

Regards,

Hope your controls turn out to be great!


DV Divya Venkatesan Syncfusion Team January 17, 2018 03:58 AM UTC

Hi Uma,

Thanks for your wishes. These fixes were included in our 2017 Volume 4 SP 1 release.

https://www.nuget.org/packages/Syncfusion.Xamarin.SfChart/  

Regards,
Divya Venkatesan


Loader.
Up arrow icon