We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to display Trackbar label at the top of the chart instead of top of each bar?

Thread ID:





131203 Jun 28,2017 01:31 AM UTC Jul 28,2017 09:26 AM UTC Xamarin.Forms 6
Tags: SfChart
Asked On June 28, 2017 01:31 AM UTC

The trackball feature offers excellent functionality when there are numerous bars in the chart. However, since each bar might be of different heights, the current functionality of displaying the label at the top of each bar is not idea. On a device these bars are hidden by finger that's sliding across the chart. 

Is there a way to show ALL labels, regardless of the bar height, at the top? 

Divya Venkatesan [Syncfusion]
Replied On June 28, 2017 03:10 PM UTC

Hi idispose,

We have prepared a sample based on your requirement by setting trackball label display mode to GroupAllPoints using platform specific code in MainActivity.cs(Android) and AppDelegate.cs(iOS). Please download the sample from the following location.

Sample: http://www.syncfusion.com/downloads/support/forum/131203/ze/TrackballSample-715726072

Please let us know, if you need any further assistance.

Divya Venkatesan

Replied On June 28, 2017 10:05 PM UTC

Hi Divya,Thank you for taking time to respond and prepare a sample. Why does this have to be done this way? Is this a limitation of the Xamarin.Forms implementation of the chart?And while this works, the template I set for each label is completely ignored. Do I have to set the template again in the Native code?Thanks

Saravana Pandian Murugan [Syncfusion]
Replied On July 5, 2017 02:08 PM UTC

Hi idispose,

Sorry for the delay.

Currently, we are trying to achieve your requirement in sample level. We will update you with more details in two business days (July 07, 2017).

Saravana Pandian M.

Parthiban Sundaram [Syncfusion]
Replied On July 7, 2017 12:24 PM UTC

Hi Idispose,

Thanks for the patience.

We have customized the ChartTrackballBehavior to achieve your requirement.


We have added the OnLabelsGenerated() and DrawLabel() override methods in ChartTrackballBehavior (CustomTrackballBehavior.cs) and added this customized trackball behavior in chart (MainActivity.cs) to achieve your requirement


we have overridden the DidTrackballLabelsGenerate() override method in SFChartDelegate using platform specifc code(AppDelegate.cs) to achieve your requirement

Sample: http://www.syncfusion.com/downloads/support/forum/131203/ze/TrackballSample827176916

Parthiban S  

Replied On July 27, 2017 09:23 PM UTC

Hi ParthibanThanks for the sample with the solution. The template now displays as I want it to, at the top of the chart. Thanks

Saravana Pandian Murugan [Syncfusion]
Replied On July 28, 2017 09:26 AM UTC

Hi Idispose,

Thanks for the update. We are glad to know that the given solution worked. Please get back to us if you need further assistance.

Saravana Pandian M.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon