Colors and colors sets

Colors and colors sets

MaxiCharts uses a default multi-colors set if no parameter is set.
MaxiCharts comes with two ways of specifying colors to use for graph elements:

  • Predefined color sets (easy to use) : use the color_set parameter, which expects the name of the color set : blue,green,red,orange,purple. For example: color_set="blue". All color set were built using this fantastic color tool.
  • Your color set, by specifying the colors directly using the following parameter : colors="#cecece,#bababa,#d4d4d4"

In all cases, colors a cycled if more series than colors to display.
Another usefull parameter is color_rand which expects 1 or 0 and randomizes colors in color set if 1 (defaults to 0).

Blue color set

[gfchartsreports include="3" height="400px" color_set="blue"]

Green color set

[gfchartsreports include="3" height="400px" type="bar" chart_js_options="title: {display: true, text: 'Without Randomization'}" color_set="green" position="float" width="48%" ][gfchartsreports include="3" height="400px" chart_js_options="title: {display: true, text: 'Randomized'}" type="bar" position="float" color_set="green" width="48%" color_rand="1"]

Red color set

[gfchartsreports include="3" height="400px" type="horizontalBar" color_set="red"]

Orange color set

[gfchartsreports include="3" height="400px" type="doughnut" color_set="orange"]

Purple color set

[gfchartsreports include="3" height="400px" type="horizontalBar" color_set="purple"]

Test it now!

  • Please enter a value between 0 and 10.

About The Author

Leave Comment