0

I am using the WPF chart from WPF Toolkit.

I am loading Performance counters data in the .csv file. If the file size exceeds >200KB or more than 50 performance counters, WPF is taking too much of time to render the chart.

Any suggestion to improve WPF Chart rendering speed

Revan
  • 1,104
  • 12
  • 27

4 Answers4

2

You should probably use some other charting library, as the WPF Toolkit Charts are not very well maintained.

A free alternative that includes many chart types is Oxyplot. But there are also many other free and paid libaries.

Staeff
  • 4,994
  • 6
  • 34
  • 58
  • I'm also using Oxyplot and can recommend it. it's really handy and fast – Breeze Jul 24 '15 at 13:54
  • If researching speed, see [Gigasoft's wpf charting example](http://www.gigasoft.com/wpfchart.html). Small eval download see demo 123 which plots 12 million points repeatedly. – Robert Oct 21 '15 at 12:27
  • 1
    this is a good option too, I actually started it because oxyplot was not what I was loking for https://github.com/beto-rodriguez – bto.rdz Jan 25 '16 at 00:52
2

There's not really much you can do to improve the performance of the WPF Toolkit Chart. The only real alternative is to use OxyPlot (which is slightly faster) or a commercial chart control (which can be considerably faster)

Check out these links which compare performance of multiple WPF Charts:

Dr. Andrew Burnett-Thompson
  • 20,980
  • 8
  • 88
  • 178
0

You might find some help in this post : Ways to improve WPF UI rendering speed

  • Cache everything. Brushes, Colors, Geometries, Formatted Texts, Glyphs. (For example we have two classes: RenderTools and TextCache. Rendering process of each unit addresses to shared instance of both classes. So if two charts have the same text, its preparation is executed just once.)
  • Freeze Freezable, if you are planning to use it for a long time. Especially geometries. Complex unfreezed geometries execute HitTest extremely slow.
  • Choose the fastest ways of rendering of each primitive. For example, there is about 6 ways of text rendering, but the fastest is DrawingContext.DrawGlyphs.
  • Use profiler to discover hot spots. For example, in our project we had geometries cache and rendered appropriate of them on demand. It seemed to be, that no improvements are possible. But one day we thought what if we will render geometries one time and cache ready visuals? In our case such approach happened acceptable. Our unit's chart has just several states. When data of chart is changed, we rebuild DrawingVisual for each state and put them into cache.

Also the toolkit is open source, it might worth the price to download the source and improve the performance of the controls theirself.

Community
  • 1
  • 1
Emmanuel Istace
  • 1,209
  • 2
  • 14
  • 32
0

Unfortunately WPF Toolkit Chart control doesn't perform well when the sample count is high. I don't think there is any way to improve it performance significantly. In general, its performance is getting slightly better when you turn off unnecessary (if not required for you) features such as Tooltips. And here are some more suggestions. But don't expect a significant improvement.

Community
  • 1
  • 1
CharithJ
  • 46,289
  • 20
  • 116
  • 131