Need a special offer?Find out if your project fits.
+

How to change de color of the graphs

Answered
Rafael Ramires asked on September 19, 2023

Hello!
 
Is there any way to change the colors shown in the graphics?

3 answers

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster 6 days ago

Hello Rafael,

Thank you for contacting us.

To change the colors of the graphics, you are welcome to check the following example on JSFiddle. You can use .fm-charts-color-n to set the color for the nth chart sector. In this example, we specify six colors. The seventh sector is specified with fill: none. This trick is used so that custom colors are repeated if there are more than six chart sectors. If the seventh sector was not specified, Flexmonster would use its own colors.

Please let us know if it works for you. Looking forward to hearing from you.

Kind regards,
Nadia

Public
Rafael Ramires 4 days ago

Nadia, good morning.
Thanks. I was able to change the colors in the pie chart, but I am not able to do so in the other types. Do I need to use another type of .fm-charts to change columns or bars colours?

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster 1 day ago

Hello Rafael,

Thank you for the response.

Kindly note that the .fm-charts-color-n classes work with all types of charts. You are welcome to check the following JSFiddle for illustration: https://jsfiddle.net/flexmonster/51p2mjrh/.
 
Alternatively, we recommend using the customizeChartElement function for more specific cases.
You can look through our guide for more details about this approach: https://www.flexmonster.com/doc/customizing-pivot-charts/.

Please let us know if it works for you. Looking forward to hearing your feedback.

Kind regards,
Nadia

Please login or Register to Submit Answer