SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components
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
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
Please login first to submit.