Chart is getting slower with increasing number of values

2 posts, 0 answers
  1. Frank
    Frank avatar
    12 posts
    Member since:
    May 2011

    Posted 08 Aug 2011 Link to this post

    Dear support team,

    we're using your Chart control to display several charts in our WPF application and have massive problems with its performance. I'd like to describe the application design and hope you have an idea how we can improve the applications performance.

    There is a TabControl with two tab items and in each of those are two charts. Only one chart is visible at any time, each chart contains two line series. The charts show measurement values which are reported every 100 milliseconds. These values are buffered and added to a ObservableCollection every second (actually just an implementation of IList and the notify interfaces to get the collection thread-safe). This collection is binded to the chart (MVVM). A measurement will take between one or two minutes, so there will be something around 1000 values for each chart.

    You can find a screen shot of the application at http://dl.dropbox.com/u/36135015/telerik%20forum/chart%20performance/GuiScreen.png

    At the beginning of a measurement switching tabs or the visibility in each tab is possible without any delays but the more values we're adding to the charts, the longer the delay is getting. After some time the application gets unusable as the UI thread is busy wile drawing(?) the chart. Important to mention: the target system is an embedded Windows 7 system with an Intel Atom CPU N270 (1,6GHz) and 1GB of RAM. Nevertheless, the delays can be noticed at our development system, too (Intel i5 2,67GHz, 8GB RAM).

    We took some advices of the support center or common wpf advices like buffering values, changing the control template, using VirtualizingStackPanel but there's no remarkable difference.

    Why is the chart getting so slow (in my opinion the drawing can't be that expensive) and are there other possibilities to fasten it up?

    I made a small demo project that uses a tab control to show four charts and fill them with data each 100 milliseconds. You'll notice that after something around 20-30 seconds the tab item changes will get remarkable slower. You can find it here: http://dl.dropbox.com/u/36135015/telerik%20forum/chart%20performance/ChartPerformance.Demo.zip

    Sincerly yours,
    Matthias

  2. Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 11 Aug 2011 Link to this post

    Hello Frank,

    We understand your scenario and in the past iterations we have made several improvements on the mechanics to make the chart work faster. In your case you are adding a small amount of points very frequently, but under the curtains RadChart rebinds itself. For example if you start with 0 points after the first second it rebinds 20 points, after 10 seconds - 200 points, and after a minute - 1200. In this case the sheer number of calculations that have to be made brings the slowdown you are experiencing.

    A much better solution could be to calculate only the points for the 2 points that you are adding every 100 milliseconds. We have logged this as a partial redraw feature request in our tracking system, but due to the complexity of the feature I cannot commit a concrete time frame for it.

    Kind regards,
    Yavor Ivanov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top