How to change the cursor to Wait while plotting?

May 28, 2012 at 10:19 PM


I have to do plots with a large quantities of data (around 300k), and I must have markers in the plot, which makes its drawing VERY slow. Therefore, I need to change the cursor to wait while OxyPlot is drawing my graph. Is it possible?

Thank you!

May 30, 2012 at 9:00 PM

The PlotModel class has two events: Updating and Updated. Try to subscribe to these, they are raised before and after the plot is updated (which probably takes most of the time).

I have not added any events before/after the visual tree is updated, but this should be easy to add if needed (in the OxyPlot.Wpf.Plot.UpdateVisuals method).

If drawing is very slow:

  • check that the binding of the data is as efficient as possible (see the performance examples (100k points) in the example browser)
  • if using the scatter series, consider using the "binning" functionality
May 30, 2012 at 9:28 PM

I could not find both of these events> Updating or Updated.

Regarding the drawing speed, it gets slower because I am using ItemsSource to get the data and because I am using markers. Is there a marker that is the fastest or they are all basically the same?

Thank you!

May 30, 2012 at 9:42 PM

See OxyPlot.PlotModel.Updating/Updated (you cannot do this from xaml)


May 31, 2012 at 2:29 PM

I still can't find the Updating method in OxyPlot,.PlotModel. The Updated event is OK.

I have been trying to do it in the code behind, not on XAML. I have checked, my OxyPlot library seems to be the latest (v4.0.30319). I don't know exactly what can be wrong.

May 31, 2012 at 7:11 PM

That is strange. Are you using the version from the Download page?

I recommend using the Nuget package or build from the latest source, the download is a bit old (I am planning to update this soon - will check the codeplex api if I can automate this part of the process).