Jump to content
JChartFX Community
  • 0
Sign in to follow this  

Changing Default Chart Colors




I would like to know how to change the default color values of the charts. We have several pie charts and we would like the individual section colors to be different.


According to the following thread: http://community.jchartfx.com/topic/293-css-vs-api-property-settings/

JuanC apparently mentioned that in future builds, all we would have to do is declare an array with the colors we would want to use (the last post in that thread). Is this possible now? If so, how do I do this?


Thanks a lot!



  • Like 1

Share this post

Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

If you are using any of the palette css files, you can control these colors by changing the AttributesX (0 and above) properties. If you are not using css files, then you will use the points API, such as:


chart1.getPoints().getItem(-1,0).setColor("#FF0000"); // This will set the point 0 color to red




Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this