We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.

How to change de color of the graphs

Resolved
Rafael Ramires asked on September 19, 2023

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

6 answers

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster September 20, 2023

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 September 22, 2023

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 September 25, 2023

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

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster October 3, 2023

Hello,

Hope you are doing well.

We were wondering if you had a chance to check the suggested approach. Could you please confirm if it works for you?

Looking forward to hearing from you.

Kind regards,
Nadia

Public
Rafael Ramires October 3, 2023

Hello, Nadia.
We tested the suggestion and it worked.
Thank you for the great service

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster October 3, 2023

Hello,

Thank you for the feedback.

We are glad to hear that it works for you. 

As always, do not hesitate to contact us if any questions arise.

Kind regards,
Nadia

Please login or Register to Submit Answer