SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

Answered
3
0

…sucks. Likely a programming error.

Trying to show a larger chart which has 16000 annotations on it. Besides that being a programming error at this point – we do / will have zoom out charts with that many data points.

I spend minutes, literally, in

Annotations.Add – no way to add an enumeration of them.

SuspendUpdates

has been called around this – so updates SHOULD not happen, but it seems there is a lot of overhead here.

What is adviced?

Besides that slowness in creating the chart, it is also (very) slow to change sizes etc.

Any advice for a heavily annotated chart?

  • You must to post comments
Best Answer
4
0

Hello there,

The Annotations feature in v1.5 uses UIElements. These are very flexible (as they are WPF elements) but are also very slow compared to the bitmap rendering that we employ in SciChart.

We did have a user once who added 50,000 annotations to a WPF SciChart. It did take a few seconds to redraw but it did perform. We got his performance down from minutes (like you) to a few seconds by using the following code:

      using (sciChartSurface.SuspendUpdates())
      {
        // Create temporary AnnotationCollection
        var myAnnotations = new AnnotationCollection();
 
        double minx = double.MaxValue;
        double maxx = double.MinValue;
 
        foreach (var c in cmdList)
        {
          if (c.X < minx) minx = c.X;
          if (c.X > maxx) maxx = c.X;
 
          var a = new BoxAnnotation
          {
            // Assign X1,Y1, Background etc... 
          };
 
           myAnnotations.Add(a);
        }

        // Reassign annotation collection
        sciChartSurface.Annotations = myAnnotations;
 
        sciChartSurface.ZoomExtents();
      }

Assigning the annotation collection in one go will prevent internal updates/redraws occurring on each add. Please try this and let me know if it helps.

Thanks!
Andrew

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.