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.

RealTime update of a PieChart

Thread ID:

Created:

Updated:

Platform:

Replies:

117471 Oct 26,2014 10:22 PM Oct 29,2014 06:18 PM WPF 5
loading
Tags: SfChart
Rodolphe Billottet
Asked On October 26, 2014 10:22 PM

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

Mohammed Azarudeen [Syncfusion]
Replied On October 27, 2014 08:54 AM

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

Rodolphe Billottet
Replied On October 28, 2014 12:34 AM

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

Mohammed Azarudeen [Syncfusion]
Replied On October 28, 2014 10:44 AM

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

Rodolphe Billottet
Replied On October 29, 2014 05:30 AM

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!
 

Rajkumar [Syncfusion]
Replied On October 29, 2014 06:18 PM

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.

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.

;