Quantcast
Channel: OxyPlot (moved to GitHub)
Viewing all articles
Browse latest Browse all 2061

New Post: Multiple LineSeries Binding

$
0
0
Hi,
I had a similar situation some months ago when I needed to "bind" a plot to a custom class which had a set of data representing plot series (mainly StairStepSeries and AreaSeries).
My solution was quite simple: I created a viewmodel which contains one property for each series (List<DataPoint>), binding (in XAML) one OxyPlot series to the corresponding property (the only limitation here is that the series are statically added in XAML but it was ok for my purposes).
To fill in the values I used a simple "SetData" method in my model with my custom class as parameter, the method assigns each "class series" to the corresponding viewmodel property and fills the series using Points.Add(DateTimeAxis.CreateDataPoint(...)) calls.
Hoping to be helpful :)
Bye!

Viewing all articles
Browse latest Browse all 2061

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>