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

Assign specific colors to chart segments

Thread ID:





142461 Feb 5,2019 11:08 AM UTC Feb 13,2019 04:13 AM UTC ASP.NET Web Forms 3
Tags: Chart
Georg Thomas
Asked On February 5, 2019 11:08 AM UTC

I am trying to work out how to assign specific colors to specific values. For example
  • Insignificant = green
  • Minor = yellow
  • Moderate = orange
  • Major = light red
  • Catastrophic = dark red
  • Late = red
  • OK = green
Is there any easy way to accomplish this?

Thanks in advance.

https://imgur.com/FougTJa (embed seems to not work)

Dharanidharan Dharmasivam [Syncfusion]
Replied On February 6, 2019 01:00 PM UTC

Hi Georg, 
Greetings from Syncfusion. 
We have analyzed your query and your requirement can be achieved using two ways.  
Method 1 
If the data are declared directly in points, then you can directly use the fill property to assign the desired color. Find the code snippet below. 
<ej:Chart ID="Chart1> 
                        <ej:points Text="Insignificant" X="Insignificant" Y="10" Fill="green" /> 
                             Other configurations 
Method 2 
If you are bind data to chart using the data source, and you are having color in your data source, then using the pointColorMappingName in series. Find the code snippet below to achieve this requirement. 
       <ej:Series PointColorMappingName="fillColor"> 
Hope this helps. 

Georg Thomas
Replied On February 12, 2019 11:18 AM UTC

Thank you! That worked a treat!

Dharanidharan Dharmasivam [Syncfusion]
Replied On February 13, 2019 04:13 AM UTC

Hi Georg, 
Most welcome. Kindly get in touch with us, if you would require further assistance. 


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

Live Chat Icon For mobile
Live Chat Icon