- Home
- Forum
- Xamarin.Forms
- Trackball position
Trackball position
Hi there, sync team!
Is it possible to always show the trackball in an specific position rather than just appear close to the point it's being selected?
Is it possible to always show the trackball in an specific position rather than just appear close to the point it's being selected?
SIGN IN To post a reply.
3 Replies
1 reply marked as answer
SM
Saravanan Madheswaran
Syncfusion Team
January 28, 2021 12:52 PM UTC
Hi Jorge,
Greetings from Syncfusion support.
We would like to let you know that we can achieve this requirement by placing the ViewAnnotation at chart top and modify label value at TrackballCreated event. Please find the code snippet below.
|
<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>
|
At event:
|
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;
}
} |
The sample will be downloaded from below location.
And please check the below links to know more on annotation and trackball.
Regards,
Saravanan.
Marked as answer
MK
Milos Kajtez
August 19, 2021 12:51 PM UTC
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.
YP
Yuvaraj Palanisamy
Syncfusion Team
August 20, 2021 04:53 PM UTC
Hi Milos Kajtez,
We have analyzed your query and currently we didn’t have annotation position support in Xamarin.Forms SfChart. Also, we have already considered this as a feature request. You can track the status of this feature from below link
We will prioritize the features every release based on the demands and we do not have an immediate plan to implement this since we committed with already planned work. So, this feature will be available for any of our upcoming releases
Please cast your vote to make it counts and If you have any more specifications/suggestions to the feature request, you can add it as a comment in the portal.
Regards,
Yuvaraj.
SIGN IN To post a reply.
- 3 Replies
- 4 Participants
- Marked answer
-
JV Jorge Valenzuela
- Jan 27, 2021 08:48 PM UTC
- Aug 20, 2021 04:53 PM UTC