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. Image for the cookie policy date

RealTime update of a PieChart

Hi,
I'm using SfChart wirh PieSeries like below
I'm displaying live data and of course I want the chart to be update when data change.
But seems it's not working properly.
Actually it is working for change on the PrimaryAxis (Add/Remove pie slice)
But it's not working for change on SecondaryAxis. I mean Count value changes do not update the PieChart.  I need to fully reset the AppStatsList to have the PieChart updated. 
Is that the normal behavior?
SfChart is not suposed to be real-time ? 
 
I have also attached a sample ! 
 
 
 
<chart:PieSeries EnableSmartLabels="true" EnableAnimation="True" 
                 ShowTooltip="True" chart:ChartTooltip.EnableAnimation="True" 
                ItemsSource="{Binding SummaryViewModel.AppStatsList}" 
                    XBindingPath="Name" YBindingPath="Count" Margin="0"/>
 
public ObservableCollection<AppStats> AppStatsList
{
   get { return _appStatsList; }
}
public class AppStats : Syncfusion.Windows.Shared.NotificationObject    
 {
     public string Name { getset; }
 
     private int _count;
 
     public int Count
     {
         get { return _count; }
         set
         {
             _count = value;
             RaisePropertyChanged("Count");
         }
     }
 }
 
 
 
 

Attachment: RtUpdate_64063d78.zip

5 Replies

MA Mohammed Azarudeen Syncfusion Team October 27, 2014 12:54 PM UTC

Hi Rodolphe,

We have analyzed your requirement and you can achieve your requirement by setting the property ListenPropertyChange as true for the PieSeries as shown in the below code snippet.

Code Snippet [XAML]:

            <chart:PieSeries ListenPropertyChange="True" x:Name="Pie" ConnectorType="Line"  XBindingPath="Country" YBindingPath="Count" ItemsSource="{Binding Data}" EnableSmartLabels="true"

Please find the attached sample

Please let us know if you have any queries.

Thanks,

Mohammed Azarudeen.


Attachment: ListenPropertyChange_978c5275.zip


RB Rodolphe Billottet October 28, 2014 04:34 AM UTC

Hi Mohammed,
 
Thanks for the solution, that work for the sample but that doesn't work for my applicaiton use case.
The reason is that there is no item in the PieSerie during intialisation.
Not really a surprise, I found so many issue/bug with empty chart...
 
I did another sample.
- There is initially only 1 item.
- 4 more item are added on the first clic

=> Only the first one got refreshed
 
For me it's a defect !
 

Attachment: RtUpdate1_ef7df750.zip


MA Mohammed Azarudeen Syncfusion Team October 28, 2014 02:44 PM UTC

Hi Rodolphe,

We have analyzed your requirement and we have prepared a sample based on your requirement (dynamically add data points and all points get refreshed). Please find the attached sample.

Please let us know if you have any queries.

Thanks,

Mohammed Azarudeen.


Attachment: ModifiedSample_4a3b8afd.zip


RB Rodolphe Billottet October 29, 2014 09:30 AM UTC

Hi Mohammed
 
Thanks for your reply. 
Basically, your workaround is just to delete and add again the same item in the collection.
I have already tested this workaround on my side and was not really a good solution for me.
 
Also the attribute ListenPropertyChange="True"  become completely usless  and that was my first request..
 
I will raise an incident because  ListenPropertyChange="True" does not work in my use-case!
 


RA Rajkumar Syncfusion Team October 29, 2014 10:18 PM UTC

Hi Rodolphe,

Sorry for the inconvenience caused.

We have analyzed your scenario and found an issue with 'ListenPropertyChange' that it doesn't works for the objects added dynamically to the underlying collection. We have logged this as defect.  We would like you to create an incident for this issue to receive the fixed patch.

Please let us know, if you need any further assistance.

Thanks,
Rajkumar BR.

Loader.
Live Chat Icon For mobile
Up arrow icon