<chart:SfChart x:Name="chart TrackballCreated="Chart_TrackballCreated">
<chart:SfChart.ChartAnnotations>
<chart:ViewAnnotation CoordinateUnit="Axis">
<chart:ViewAnnotation.View>
<border:SfBorder BorderColor="#f77e09" Padding="10" BorderWidth="2" CornerRadius="5">
<StackLayout Orientation="Vertical">
<Label Text="{Binding CurrentValue, Converter={StaticResource formatConverter}}" FontAttributes="Bold" FontSize="15" HorizontalOptions="Center"/>
<Label Text ="{Binding CurrentDateTime, Converter={StaticResource formatConverter}}" FontSize="12"/>
</StackLayout>
</border:SfBorder>
</chart:ViewAnnotation.View>
</chart:ViewAnnotation>
</chart:SfChart.ChartAnnotations>
</chart:SfChart>
|
private void Chart_TrackballCreated(object sender, ChartTrackballCreatedEventArgs e)
{
foreach (var info in e.ChartPointsInfo)
{
var viewModel = this.BindingContext as TrackballViewModel;
viewModel.CurrentDateTime = (info.DataPoint as ChartDataModel).DateTime;
viewModel.CurrentValue = (info.DataPoint as ChartDataModel).Value;
}
} |
Hello,
I have similar issue. I have track ball and annotation to show data, but trackball line goes over annotation and text. Is there a way to affect zindex or any other way to make sure annotation is on top?
Annotation is over the graph lines as needed, but trackball line is on top.