Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
45
XamDataChart show busyindicator while drawing
posted

Hello,

I have a XamDataChart that I put a lot of series (10-50) in with plenty of points in for each (500-1.000) and understandably it takes a while to render. While I generate the data I have a XamBusyIndicator showing. I can't use the following code on a worker thread:

foreach (ScatterSplineSeries ser in sps) { dataChart.Series.Add(ser); }

because dataChart is not owned by it. What I want to know is if there is a way to put the data in there (probably from the gui thread) and then continue displaying the busyindicator while the datachart is loading.

Thanks.

Parents
No Data
Reply
  • 28496
    Suggested Answer
    Offline posted

    The main performance bottleneck here is in the WPF rendering stack / visual tree, so there's nothing that can be handled as a background operation.  Putting busy indicators on a second UI thread is possible using VisualTargetPresentationSource.  This is difficult to implement, but it could be the solution you're looking for.

    Going back to the chart, adding the series must happen on the UI thread.  However, this can be made more bearable by time-slicing.  Consider this code: http://pastebin.com/y9QXtAiL

    Some other things that might help are setting the Series.MarkerTemplate to something simpler than the default, avoiding Bindings as much as possible, and using Series.UseLightweightMarkers.  UseLightweightMarkers will skip the measure and offset operations, so your makers will not be centered-- however, this can be remedied by using fixed size markers with negative margins.

Children