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.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

118933 Apr 24,2015 07:56 PM Apr 27,2015 06:31 AM ASP.NET Web Forms 1
loading
Tags: Chart
Mark Wise
Asked On April 24, 2015 07:56 PM


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!

Vinothkumar Arumugam [Syncfusion]
Replied On April 27, 2015 06:31 AM

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.



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.

;