[DevExpress Support Team: CLONED FROM T197360: WPF Pie Chart - Legend and Labels MVVM DataBinding]
Hi,
I am looking at real time update of pie chart with above example using MVVM. One way i found was chartControl.Update method. But, if I update Value property of DataPoint and DataPoint is implemented INotifiyPropertyChanged, chart is not updating.
Can you please suggest, is there any way to update real time using MVVM?
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hi Naveen,
Would you please clarify your MVVM structure and which data source you are using in your chart. If it is possible provide a small sample project that illustrates this behavior.
I suggest you review the Chart bound to ObservableCollection does not update when collection members are updated topic that describes a similar problem with ObservableCollection.
Thanks for your feedback.
My MVVM structure is simple as collection of DataPoints (which is mentioned in https://www.devexpress.com/Support/Center/Question/Details/T197360)
I understood that, we need to implement INotifyCollectionChanged for updating the chart whenever value in the collection changes.
Please let me know, if my understanding is wrong.
Yes, you are right, Naveen. It is necessary to implement it. Feel free to contact us if you have further questions. We are here to help you at any time.
That's great. That worked for me. Thanks for your kind help.
You are welcome.
Hi, running into the same issue. This post is a couple years old at this point and wondering if there is anything new in the DevExpress framework to handle his more elegantly?
Hello Christopher,
This approach is a general solution for the MVVM pattern and is not directly related to our controls. Data bound controls cannot update their content if they do not receive notifications that their data source has been changed. Would you please clarify if this approach does not meet your requirements or you cannot implement it in your application?
Hi John,
I can make it work. I just thought before I implemented this approach it would be worth checking if there wasn't a better way to handle it. Thanks for getting back to me.
Chris