How to change the color of a bar chart created with Chartkick?

Can I change the color of a column chart created with Chartkick? I searched for it inside the Documentation, but I could not find anything about it. Any ideas?

+4
source share
2 answers

In Google Charts, use the library option to change the color of the entire series.

<%= column_chart data, :library => {:colors => ["red"]} %>

There is currently no easy way to change each panel in one series.

https://developers.google.com/chart/interactive/docs/gallery/columnchart

+5
source

I think this might work like this:

  = column_chart(@data, library => { :series => { 0 => { color: "red" } }

Similarly, you can determine what for each series.

0
source

Source: https://habr.com/ru/post/1530073/


All Articles