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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

131203 Jun 27,2017 09:31 PM Jul 28,2017 05:26 AM Xamarin.Forms 6
loading
Tags: SfChart
idispose
Asked On June 27, 2017 09:31 PM

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 11:10 AM

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


idispose
Replied On June 28, 2017 06:05 PM

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 10:08 AM

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.

Parthiban Sundaram [Syncfusion]
Replied On July 7, 2017 08:24 AM

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  


idispose
Replied On July 27, 2017 05:23 PM

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 05:26 AM

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.


CONFIRMATION

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.

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.

;