Color Palettes

In most situations, you will want to assign colors to chart elements like markers, backgrounds and labels. However, our design team invested a lot of time creating default color palettes for Chart FX. This way, when you create a chart and populate it with data, everything looks nice and consistent (even if you have not taken the time to assign default colors to chart elements).

Note: This image depicts the Chart FX for Java active chart toolbar. Palettes may be configured programmatically when generating chart as images. Please see the Active Charts section for more information regarding this topic.

If you buy into the Chart FX way of coloring your chart, you'll find out Chart FX for Java provides other palettes that you, or your end users, can use to quickly change the chart.

Essentially, Palettes are a group of colors that will apply to the different elements in the chart. When a palette is changed all the elements that have not been forced to have a specific color will adapt to the new palette.

Using Palettes Programmatically

Palettes are supported through your IDE properties list or you can load and apply them through the chart using the Palette property.

Please note, the palette property receives a string parameter with the name of the palette you want to load. Chart FX supports the following default palettes: Windows, Alternate, EarthTones, ModernBusiness, ChartFX6.

Each of these palettes belongs to a default palette list in Chart FX. Therefore, the "Default." String must precede each of these names to properly load the palette. The Palette property must be set as follows:


chart1.setPalette("Default.EarthTones");