Hi Hung,
Thanks for contacting Syncfusion Support.
We have analyzed the reported problem (axis label in annotation displaying with 2 decimal precision always) since we have internally round off the corresponding axis value with 2 decimal precision. However, we can resolve this problem by binding actual axis value directly to the Text in TextBlock of AxisLabeltemplate . Please refer the below codes,
Code Snippet[XAML]
|
<chart:SfChart.Annotations>
<chart:HorizontalLineAnnotation
Name="CurrentPrice"
ShowAxisLabel="True"
Y1="1.2101"
HorizontalTextAlignment="Center"
>
<chart:HorizontalLineAnnotation.AxisLabelTemplate>
<DataTemplate>
<Border CornerRadius="2">
<Grid Background="#1E90FF" Width="40" MinHeight="20">
<TextBlock Text="{Binding Y1, ElementName=CurrentPrice}" Padding="2" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"></TextBlock>
</Grid>
</Border>
</DataTemplate>
</chart:HorizontalLineAnnotation.AxisLabelTemplate>
</chart:HorizontalLineAnnotation>
</chart:SfChart.Annotations> |
Please find the output screenshot below,
Please find the reference sample from below link,
Regards,
Durgadevi S