Jump to content
Software FX Community

ChartFx and MVVM


AlexeyRedko

Recommended Posts

Hello ChartFx team!

I have  a common question  about what is the best way to be intergrated with chart fx.

As far as I understand (from my little experience) wpf chart fx is rather good for working with "static" data (I mean there is no interaction with chart).Here I can use benefits of wpf binding model.The problem that my case is little complicated:

The chart has to support dynamic loading of data,each series may be located on different pane ,the color of series can be changed from outside,drag and drop series from pane to pane ,adding annotations by user and programmaticly,special axis x and axis y formatting and sometimes drawing custom grid lines.

Frankly speaking I implemented most of the functionality programmaticly, without using the wpf binding model ,but now I have a question if it is realy right way or anyway I should take "wpf" aproach using databinding and behavior. 

 

 

Link to comment
Share on other sites

Personally, I think binding has its place but trying to support every possible chart feature with binding may not be practical or even possible.

In the scenario you describe I would say binding is appropriate for

- Passing Data: We do support INotifyPropertyChanged and INotifyCollectionChanged so changes in your data should be replicated automatically to the chart, note that even though we optimized handling collection notification events when the data is passed to the chart (Chart.ItemsSource),it has not been optimized if you pass data on a per-series basis when handling these collection notification events.

- Color and other Series Attributes: We do support binding in most of the series attributes, note that because your series might be dynamic you might have to setup these bindings through code but might make your UI simpler to develop.

For the other features you are using, drag & drop series from panes, annotations, axis formatting and custom grid lines I would not try to use bindings. This might not go well with a strict MVVM approach but I am not sure if it is practical or even possible to handle everything with bindings.

JuanC

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...