Chart line series null value ERROR

2 posts, 0 answers
  1. XamDev
    XamDev avatar
    1 posts
    Member since:
    Jan 2020

    Posted 25 Jan Link to this post

    When our data is loaded and have a null value it causes crash to our app and catches an "Object reference not set to an instance of an object". 
    But this issue is only happening on iOS platform. Can someone help me this is a crucial issue for me and my team. 

    public class NumericalData
    {
        public object XData { get; set; }
     
        public double? YData { get; set; }
    }


    {System.NullReferenceException: Object reference not set to an instance of an object
      at Telerik.XamarinForms.ChartRenderer.iOS.ManagedChartDataSource.AddPoints (TelerikUI.TKChartSeries series, System.Collections.IList newItems) [0x00196] in <22603cf6132d4ae9966514a9a3d3a88a>:0 
      at Telerik.XamarinForms.ChartRenderer.iOS.BaseChartRenderer`1[T].Telerik.XamarinForms.Chart.IChartRenderer.OnSeriesSourceCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e, System.Object series) [0x0004e] in <22603cf6132d4ae9966514a9a3d3a88a>:0 
      at Telerik.XamarinForms.Chart.ChartSeries.OnItemsSourceCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00017] in <22603cf6132d4ae9966514a9a3d3a88a>:0 
      at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00018] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.ObjectModel/src/System/Collections/ObjectModel/ObservableCollection.cs:263 
      at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.ObjectModel/src/System/Collections/ObjectModel/ObservableCollection.cs:338 
      at System.Collections.ObjectModel.ObservableCollection`1[T].InsertItem (System.Int32 index, T item) [0x0001a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.ObjectModel/src/System/Collections/ObjectModel/ObservableCollection.cs:196 
      at System.Collections.ObjectModel.Collection`1[T].Add (T item) [0x00020] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/Common/src/CoreLib/System/Collections/ObjectModel/Collection.cs:71 
      at NutritionalFitness.Mobile.ViewModels.ProgramPhaseViewModel.SetGraphsData (System.Collections.Generic.IEnumerable`1[T] weightIns, System.Collections.Generic.IEnumerable`1[T] waterIntakes) [0x00152] in D:\Work\NutritionalFitness\NutritionalFitness.Dev\NutritionalFitnessMobile\NutritionalFitness.Mobile\ViewModels\ProgramPhaseViewModel.cs:184 
      at NutritionalFitness.Mobile.ViewModels.ProgramPhaseViewModel.SetProgramPhaseComponents () [0x002d4] in D:\Work\NutritionalFitness\NutritionalFitness.Dev\NutritionalFitnessMobile\NutritionalFitness.Mobile\ViewModels\ProgramPhaseViewModel.cs:90 }


  2. Yana
    Admin
    Yana avatar
    4974 posts

    Posted 27 Jan Link to this post

    Hello,

    We've come across such an issue with the upgrade of Visual Studio to 16.3.1.  The exception is resolved with one of the R3 2019 minor releases (2019.3.1004) and is also included in our latest R1 2020 release. Here is the feedback item on the matter:

    https://feedback.telerik.com/xamarin/1431067-chart-ios-invalidcastexception-is-thrown-when-the-chart-is-loaded

    You need to update to at least 2019.3.1004 to get the exception resolved.

    Let me know if you have any additional questions on this.

    Regards,
    Yana
    Progress Telerik

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top