Note that there are some explanatory texts on larger screens.

plurals
  1. POMost performant way to graph thousands of data points with WPF?
    primarykey
    data
    text
    <p>I have written a chart that displays financial data. Performance was good while I was drawing less than 10.000 points displayed as a connected line using <code>PathGeometry</code> together with <code>PathFigure</code> and <code>LineSegment</code>s. But now I need to display up to 100.000 points at the same time (without scrolling) and it's already very slow with 50.000 points. I was thinking of <code>StreamGeometry</code>, but I am not sure since it's basically the same as a <code>PathGeometry</code> stroring the information as byte stream. Does any one have an idea to make this much more performant or maybe someone has even done something similar already?</p> <p>EDIT: These data points do not change once drawn so if there is potential optimizing it, please let me know (line segments are frozen right now).</p> <p>EDIT: I tried StreamGeometry. Creating the graphic took even longer for some reason, but this is not the issue. Drawing on the chart after drawing all the points is still as slow as the previous method. I think it's just too many data points for WPF to deal with.</p> <p>EDIT: I've experimented a bit and I noticed that performance improved a bit by converting the coordinates which were previously in double to int to prevent WPF anti-aliasing sub-pixel lines.</p> <p>EDIT: Thanks for all the responses suggesting to reduce the number of line segments. I have reduced them to at most twice the horizontal resolution for stepped lines and at most the horizontal resolution for simple lines and the performance is pretty good now. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload