Pre loader

Annotation label on top of data

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

Hi,

I’m using 2 annotation markers, one horizontal and one vertical.

In xaml:

            <SciChart:SciChartSurface.Annotations>
                <SciChart:HorizontalLineAnnotation HorizontalAlignment="Stretch" IsEditable="True" LabelPlacement="Axis" LabelTextFormatting="0.0" ShowLabel="True" Stroke="Orange" StrokeThickness="2" Y1="{Binding Path=UpRightMarkerYPos, Mode=TwoWay}" IsHidden="{Binding Path=TimeChartMarkerIsHidden}"/>
                <SciChart:VerticalLineAnnotation VerticalAlignment="Stretch" IsEditable="True" LabelPlacement="Axis" LabelTextFormatting="0.0" ShowLabel="True" Stroke="Orange" StrokeThickness="2" X1="{Binding Path=BowMarkerXPos, Mode=TwoWay}" IsHidden="{Binding Path=TimeChartMarkerIsHidden}"/>
            </SciChart:SciChartSurface.Annotations>

I’ve set the LabelPlacement on Axis, so I expect that the labels will not be drawn over the graphical data.
It works fine for the Vertical one, but the horizontal marker will display the label over the data, so I can’t see a part of my graph anymore.
How can I position the label so it will not be on top of the graphical data?

Thanks,
Egbert

Images
  • You must to post comments
0
0

Hi there,

This is by-design behavior, which prevents labels to be clipped if they’re wider then the axis they are placed on. But you can work around it in such a way:

                <s:HorizontalLineAnnotation HorizontalAlignment="Stretch"
                                            IsEditable="True"
                                            StrokeThickness="2"
                                            Y1="..."
...>
 <!-- add small offset as a workaround -->
                    <s:AnnotationLabel LabelPlacement="Axis"
                                       TextFormatting="0.0"
                                       Canvas.Left="-5"/>
                </s:HorizontalLineAnnotation>

Or you can rotate the label:

                <s:HorizontalLineAnnotation HorizontalAlignment="Stretch"
                                            IsEditable="True"
                                            StrokeThickness="2"
                                            Y1="...">
                    <s:AnnotationLabel LabelPlacement="Axis"
                                       TextFormatting="0.0"
                                       RotationAngle="90"
                                       Canvas.Right="0"/>
                </s:HorizontalLineAnnotation>

Please, let us know if any of these is suitable for you,

Best regards,
Yuriy

  • EJansen
    Hi, It could be an option if it works, but now the formatting does not work anymore... (see attachments) Best regards, Egbert
  • Yuriy Zadereckiy
    Hi Egbert, You should set ShowLabel="False"(by default) from annotations definitions to prevent second label from being shown. Now you have two overlapped labels, the first is automatically created by ShowLabel="True", and the second is created explicitly in the markup I post above. Hope this helps! Best regards, Yuriy
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies