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

Show custom legend label and color for sfchart xamarin forms

Thread ID:





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


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 04:21 PM UTC

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.

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