Update an existing data point.

Hello,

I’m using Xamarin Forms and building MVVM based application. I want my ViewModel to take care of number and type of series in chart, so I am trying to bind item source:

this.OneWayBind(ViewModel, vm => vm.CheckInData, v => v.series.ItemsSource).DisposeWith(disposable);

where CheckInData is defined in ViewModel:
public ObservableCollection CheckInData { get; set; }

HistoryСhart:

public class HistoryСhart : INotifyPropertyChanged
   {
       private string _days;
       public string Days
       {
           get { return _days; }
           set { _days = value; NotifyPropertyChanged(); }
       }
       private double _height;
       public double Height
       {
           get { return _height; }
           set { _height = value; NotifyPropertyChanged(); }
       }

       public event PropertyChangedEventHandler PropertyChanged;

       private void NotifyPropertyChanged([CallerMemberName] String propertyName = “”)
       {
           if (PropertyChanged != null)
           {
               PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
           }
       }

   }

and when I change CheckInData:

CheckInData [0] = new HistoryShart { Days = “SQ”, Height = 10 };

The new data is recorded, but not drawn, but if I flip the device screen, the new data is drawn.

I’m using xamarin forms 2.5.0.280555 and Syncfusion.Xamarin.SfChart 16.1.0.37

1 Reply

MK Muneesh Kumar G Syncfusion Team June 11, 2018 10:27 AM UTC

Hi Timofey, 
 
Thanks for using Syncfusion products.   
  
We have analyzed your query and we have tried with simple sample in mentioned scenario in your update. It works fine with dynamic data change, it has reflected in chart view immediately.  
 
Can you please check with the sample in the following location? If your scenario is different from this means, please revert us by modifying the sample based on your application along with replication procedure. This would be helpful for us to serve you. 
 
   
Thanks,  
Muneesh Kumar G  
 


Loader.
Up arrow icon