🍉 Meet Flexmonster Pivot Table & Charts 2.9.Check out all hot features!
Get Free Trial

How to assign colors to Bar and Column charts?

Ralys asked on October 25, 2017

I need assign custom colors to Bar and Column charts
How can I do that?
Thank you

3 answers

Tanya Gryshko Tanya Gryshko Flexmonster October 27, 2017

Hello, Ralys,
Thank you for writing.
Please check out this example on JSFiddle. We use .fm-charts-color-n to set the color for the n-th chart sector. In this sample, we have specified six colors. The seventh sector is specified with fill: none. This trick is used for repeating custom colors in case there are more than six chart sectors. If the seventh sector was not specified, Flexmonster would use its own colors.
Let me know if the above approach was helpful.

Ralys October 29, 2017

With Pie chart it working
With Bar and Column all bars are colored from .fm-charts-color-1
The .fm-charts-color-2 …n not working
What I am doing wrong?

Dmytro Zvazhii Dmytro Zvazhii Flexmonster October 31, 2017

Hello Ralys,
Please check the following example – http://jsfiddle.net/flexmonster/wLqupkc5/3/. As you can see, the main difference is that in the first instance the Country field is set for columns but in the second instance it is located in rows. For pie charts pivot uses fields from rows to draw the legend. When it comes to bar and column charts the legend will be drawn from the fields located in columns.
Please let us know if you have any additional questions.

Please login or Register to Submit Answer