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

What is the Default/Built-in Chart Color List?


I'm creating a page with several chart controls.

The nature of the data of one of the controls requires me to use custom colors for the series (bar columns on a bar chart.)  So, I'm using random colors.

However, I think it would be much more helpful to have the colors on this custom chart match the default "built-in" colors of the other charts (line, pie, donut, etc.)

Is there a way I can obtain the default color list as it appears?  (Red, Oranges, etc.)

Thanks in advance!

1 Reply

VA Vinothkumar Arumugam Syncfusion Team April 27, 2015 10:31 AM UTC

Hi Mark Wise,

Thanks for using Syncfusion product. We have analyzed your query and you can get the default series colors from “model.colors” as like in the below code snippet. We also like to inform you that you can also set custom colors using “palette” as like in below code snippet.

Code Snippet:

I. Get default built-in colors.

Code Snippet[ASP] : [Default.aspx]

var chartObj = $("#Chart1").ejChart("instance");

var colors=chartObj.model.colors;

II. Set custom colors:

Code Snippet[ASP] : [Default.aspx]

$("#Chart1").ejChart({palette: [ "#0CBDF4", "#A2CE36", "#F94165"] });

We have prepared following sample based on your requirements and it can be downloaded from below sample link.

Sample link:
WebApplication2.zip

Please let us know if you have any concern.

Thanks,

Vinothkumar Arumugam.



Loader.
Live Chat Icon For mobile
Up arrow icon