1

I'm developing an app for Windows 10 Mobile and need to draw a chart within that app, which I am doing with the WinRTXamlToolkit for UWP.

All in all the charts work pretty good when it comes to styling, populating with data etc, but a major problem I have is, that the rendering of the chart needs +-15 seconds, which is quite blocking a fluent user experience...

The chart gets filled with 512 values, has two series (areaseries + lineseries) and some custom styling via xaml (chart itself is created in C#). Any possible way to speed it up?

Thanks

2
  • Did some further testing: The generating of the two chartseries incl. populating them with data, setting style etc is almost immediately done. Therefore the actual blocking process is the actual adding of the fully prepared chart to the UI (with ChartPanel.Child = chart where ChartPanel is an empty StackPanel) Any Ideas? Commented Mar 9, 2016 at 13:27
  • Short Update: In the meantime I've tried to do as much of the chart-creating as possible via xaml and I'm only doing the math I need via C# + adding those values to the chart like this: ElevationChart.Height = ActualHeight / 2.5; ElevationAreaSeries.ItemsSource = eleChart.Items; ElevationAreaSeries.DependentRangeAxis = eleChart.DependentRangeAxis; ElevationAreaSeries.IndependentAxis = eleChart.IndependentAxis; But the loading/rendering of the chart is still as slow as before. Nobody any idea? Commented Mar 16, 2016 at 14:08

1 Answer 1

1

It's possible the Chart control could be tuned to run faster, but 512 is quite a lot of data points, so it might be difficult.

I would recommend a 4 step approach

  1. Make sure the problem still exists when you build a release configuration with .NET Native compilation on.
  2. Do some performance analysis using a profiler and find out if there's code you could improve.
  3. Consider reducing the number of data points. Having 512 values shown on a phone screen isn't likely to matter that much and you could probably be fine with reducing it to 10-50 points.
  4. Try some other chart controls or better yet - implement your own chart control drawn with Direct2D (using SharpDX or Win2D to avoid switching to C++). You should be able to get real-time performance in a few days of work. I have a sample app that uses Win2D to render real-time chart updates here.
Sign up to request clarification or add additional context in comments.

4 Comments

Thank you for your help. Another question: is it possible to do this blocking stuff in background anyhow? My problem isn't directly the time it takes to load, but that it blocks the ui-thread, therefore the application freezes for a few seconds..
I doubt that, since the problem happens when you create UI elements.
Hi. I had/have the exact same problem: slow performance rendering a chart using this toolkit (around 400 data points, taking around 7-8 sec). However, I just noticed that a new nuget package has been released of the winrtxamltoolkit here in March 2016 (first update in two years!). The performance in the new version seems to be better! So try to update your packages if you haven't done so already :)
Well, there have been many updates over the last two years, but they were all in nuget.org/packages/WinRTXamlToolkit.UWP and I kept the main package compatible with 8.1. I only recently decided to break that compatibility and the main package family is now all UWP-only. Also, indeed, I made some changes recently to try to improve that update performance by getting rid of animations that were used whenever the data changed since it seems like most people care more about update performance than having nice animations. I'm glad to hear it works for you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.