0

Programmatically added series are not displayed

Daniele Fusi 9 years ago 0

I'm trying to use OxyPlot in a scenario where I'm setting up the chart type and adding 1 or more series to it programmatically. Thus, in my code I create a new PlotModel object, add the required axes to it, create a new series object, add some data points to it, and finally call InvalidatePlot(true) to let the chart draw itself. Yet, nothing is displayed. The only code samples I found refer to the typical scenario where a XAML view binds to a bound datasource, but here I'm recreating the PlotModel each time, according to the chart type and series count. You can find a dummy repro solution here: http://1drv.ms/1R8EFBc . Just compile and run, and click Add series. Could anyone suggest a solution?