How to change the cursor to Wait while plotting?

Oystein Bjorke 4 years ago 0
This discussion was imported from CodePlex

jpnavarini wrote at 2012-05-29 00:19:

Hello,

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!


objo wrote at 2012-05-30 23:00:

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

jpnavarini wrote at 2012-05-30 23:28:

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!


objo wrote at 2012-05-30 23:42:

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

See http://oxyplot.codeplex.com/wikipage?title=Performance


jpnavarini wrote at 2012-05-31 16:29:

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.


objo wrote at 2012-05-31 21:11:

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).

CodePlex