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. Image for the cookie policy date
close icon

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

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? 



6 Replies

DV Divya Venkatesan Syncfusion Team 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.

Regards,
Divya Venkatesan



ID idispose 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


SP Saravana Pandian Murugan Syncfusion Team 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).

Regards,
Saravana Pandian M.


PS Parthiban Sundaram Syncfusion Team July 7, 2017 12:24 PM UTC

Hi Idispose,

Thanks for the patience.

We have customized the ChartTrackballBehavior to achieve your requirement.

Android:

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

iOS:

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

Regards,
Parthiban S  



ID idispose 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


SP Saravana Pandian Murugan Syncfusion Team 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.

Regards,
Saravana Pandian M.


Loader.
Live Chat Icon For mobile
Up arrow icon