SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & 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.

1
0

Using annotations now and it is looking great. Many of my data points have annotations and because of that they frequently overlap even though there is a lot of “free” space in the graph. Does SciChart support out of the box auto placement to prevent box annotations overlapping by moving them to an empty spot and draw an arrow to the x,y coordinate for the annotation?

  • You must to post comments
1
0

I currently have reduced the problem by rotating the annotations to limit the amount of overlap until the client gives a go to move from winforms to wpf ( and SciChart). At the moment just testing out its features and making a relative quick prototype.

The way I was considering doing it is letting the user of scichart define a grid size ( let’s say 10 x 10 ). Then the graph area would have 100 blocks with known size. It would be relatively easy to check if a block is already occupied by an earlier annotation as the placement and size of the earlier annotations are known. If so find a close empty space, which can be fast for a small grid size, and place it there and draw an arrow from there to x,y as defined in the annotation. This has some problems; arrows might be drawn on top of series data, annotations might be to far away from the original x,y for the annotation, too many arrows etc. But it might be a simple way to start.

If the client decides to move to the new platform I’ll give it some more thought and check for existing placement algorithms ( there should be many as auto placement is a common problem in many fields).

Thanks for all the help and great answers.

<s:TextAnnotation x:Class="UserControls.CustomTextAnnotation"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
         xmlns:s="http://schemas.abtsoftware.co.uk/scichart"
         mc:Ignorable="d"
         d:DesignHeight="300" d:DesignWidth="300"
         Text="{Binding LabelText}"
         VerticalAnchorPoint="Center"
         HorizontalAnchorPoint="Right"
         FontSize="16"
              RenderTransformOrigin="1.0,0.5"
         X1="{Binding X1}"
         Y1="{Binding Y1}">


<s:TextAnnotation.RenderTransform>
    <TransformGroup>
        <RotateTransform Angle="45"/>
        <TranslateTransform Y="-5"/>
    </TransformGroup>
</s:TextAnnotation.RenderTransform>

  • You must to post comments
0
0

Hi Michel,

No, sorry we don’t have a placement strategy for annotations. They are merely placed at the exact X,Y locations you specify. We do provide virtualisation of annotations, e.g. when out of view, they are not drawn, but when in the viewport, they are always drawn at the locations you specify.

The computational overhead of such an algorithm would be high. However, for small numbers of annotations it might make perfect sense. Do you have any suggestions on how we could implement an algorithm? If so, we could possibly expose an API allowing you to override the placement strategy.

Best regards,
Andrew

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.