Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

wpf slow graphs

I am using WPF graphs to plot some particle size distributions, about 40 of them but the problem is after plotting the graph it takes a long time before they are actually seen and during this time my UI is frozen. I have tried optimising the graph by setting SupressScaleLayout to false and using Raster mode. I also noticed that it takes quite a long time to clear the graph as well ( I clear the graph by calling .Data.Clear() and .Plots.Clear() methods. Is there a faster way to clear the graphs and what else can be done to make the graph faster. Also is it possible to do all the rendering of the graph in another thread?

 

Thank you.

0 Kudos
Message 1 of 2
(5,603 Views)

First, from the Optimizing the WPF Graphs topic, you would want to set the SuppressScaleLayout to true to improve performance, and there is no option available to render the graph on another thread.


Calling Data.Clear should be relatively quick (the graph just needs to send "no data" out to all the plots). However, large or frequent updates to the Plots collection require more work. If possible, it would be better to set up plots in advance and leave the collection unchanged thereafter, only updating Data as needed.


It would be helpful to know the type of data you are sending to the graph (e.g. double[], Point[], AnalogWaveform<double>, etc), and how you are making updates to the data. Also, if you could provide a project that reproduces the issue, it would make it much easier to debug your problem.

~ Paul H
0 Kudos
Message 2 of 2
(5,565 Views)