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.

Show custom legend label and color for sfchart xamarin forms

Thread ID:

Created:

Updated:

Platform:

Replies:

130942 Jun 12,2017 06:43 PM Jun 13,2017 12:21 PM Xamarin.Forms 1
loading
Tags: SfChart
Naveen C Ramachandrappa
Asked On June 12, 2017 06:43 PM

Hi,

I am using sfchart in my xamarin forms app. The color of the bars depends on the value of the bar and the bars can take 4 different colors. I could do this using custom brushes.

But now, I want to show only 4 legends corresponding to these four color of bars. Is there a way to do this?

In short I need the following. A snapshot of the chart is shown below. As you can see, I am getting only one legend here. But I need 4 based on bar colors.

Bar value 0 - 75 , Legend label - Below threshold, legend color - red
Bar value 75 - 100 , Legend label - between threshold and target, legend color - yellow
Bar value 100 - 150 , Above target and below excellence, legend color - green
Bar value > 150  , Legend label - Above excellence, legend color - blue






Saravana Pandian Murugan [Syncfusion]
Replied On June 13, 2017 12:21 PM

Hi Naveen,

Thanks for using Syncfusion product.

We have achieved your requirement using the custom legend instead of built-in legend items. In the sample, we have used BoxView and Label as LegendLayout and added this in ScrollView for scrolling.

Sample: http://www.syncfusion.com/downloads/support/forum/130942/ze/CustomLegendLabel365994400

Please check the sample and let us know if you need further assistance on this.

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.

;