Although the Chart
ObservableCollection will be providing appropriate notifications, I don't think the chart/plot itself will necessarily be responding to those notifications, so it may well not know it needs to be redrawn.
I'm not familiar with OxyPlot, but I had a quick crack at following a tutorial, and from a quick scan of the Plot
class, I found a method called InvalidatePlot()
, which seems to force the plot to redraw itself - it may well be the case that you need to call that if you're intend on making changes to the plot data. It certainly worked when I tried it in a small sample project.
I didn't find a huge amount of example usage, however these links may help:
http://oxyplot.codeplex.com/discussions/398856
http://oxyplot.codeplex.com/discussions/352003
And this is the example referred to in the second of those links:
Edit:
It looks like the intended approach may well be to create a PlotModel
and bind the Model
property of your plot to it, you can then notify the UI when the PlotModel
changes:
oxyplot.codeplex.com/SourceControl/latest#Source/Examples/WPF/WpfExamples/Examples/RealtimeDemo/