We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Chart not update when modify collection

Thread ID:

Created:

Updated:

Platform:

Replies:

124212 May 24,2016 05:03 PM May 27,2016 06:58 AM Xamarin.Forms 5
loading
Tags: SfChart
Atif
Asked On May 24, 2016 05:03 PM

I have used code behind technique to bind chart with collection by using ItemSource Property but the problem is if i modify collection i have to rebind the chart it does not refresh automatically.

Gobi M [Syncfusion]
Replied On May 25, 2016 09:15 AM

Hi Atif, 
 
Thanks for contacting Syncfusion support. 
 
We are able to achieve your requirement using ListerPropertyChange property. We have prepared a sample which can be downloaded from the below location. 
 
 
Please let us know for any concerns. 
 
Regards, 
Gobi M 


Atif
Replied On May 25, 2016 02:36 PM

Thanks a lot!

Well I am binding chart at code behind .
I have four Collections Hour , Weekly , Monthly , Yearly and inside view I have one chart control and four buttons on each button click I change the ItemSource property of the chart.

I call this method on each click and my view bind the chart with four different collections.
      public   void OnFilterGraphByType()
        {
            switch (FilterType)
            {
                case "Daily":
                    this.BindingContext = MyWellness.VMViewModelStatic.Temperature_HourData;
                    break;
                case "Weekly":
                    this.BindingContext = MyWellness.VMViewModelStatic.Temperature_WeekData;
                    break;
                case "Monthly":
                    this.BindingContext = MyWellness.VMViewModelStatic.Temperature_MonthData;
                    break;
                case "Yearly":
                    this.BindingContext = MyWellness.VMViewModelStatic.Temperature_YearData;
                    break;
            }
        }

If I use your technique it works perfect but I have different data on each filter that's why I have four collections
Right now on Add and update methods I am using Messaging of xamarin forms to achieve the result but I would love to have automatic mechanism because I have 10 different charts in my app.

Thanks.

Gobi M [Syncfusion]
Replied On May 26, 2016 06:14 AM

Hi Atif, 
 
We are able achieve your requirement for dynamic chart series collection change. We have prepared a sample for this and it can be downloaded in the below link. 
 
 
Please let us know if you need any further assistance.  
 
Regards, 
Gobi M 


Atif
Replied On May 26, 2016 11:54 AM

Well I have already used this technique my problem is if I modify collection means to say if add new entries in hour , daily, monthly collection so after modification I have to click on the filter button to get the latest changes I am looking for auto update...

Gobi M [Syncfusion]
Replied On May 27, 2016 06:58 AM

Hi Atif, 
  
We would like to clarify the exact requirement with you, for providing better solution asap.  
  
You have a chart with one series and it initially bound with any one of the (hourly, monthly or daily) data collection. Your requirement is to replace the Chart ItemsSource with the data, which is modified (ex. Add, remove, insert...) dynamically, without any action. 
  
For an example: Initially chart rendered with Year data. Now adding one data to month collection and it should automatically update chart series with month data without clicking on any filters." 
  
If this is not your requirement, kindly update us the requirement in details to assist you better. 
  
Regards, 
Gobi M 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;