如何更改用Chartkick创建的柱形图的颜色? [英] How to change the color of a Column-chart created with Chartkick?
本文介绍了如何更改用Chartkick创建的柱形图的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以更改用Chartkick创建的柱形图的颜色?我在文档中搜索了它,但是找不到任何东西。有想法吗?
Is it possible to 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?
推荐答案
对于Google图表,请使用库选项更改整个系列的颜色。
For Google Charts, use the library option to change the color of the entire series.
<%= column_chart data, :library => {:colors => ["red"]} %>
目前没有简单的方法可以更改单个系列中的每个小节。
There's not an easy way to change each bar in a single series at the moment.
https://developers.google。 com / chart / interactive / docs / gallery / columnchart
这篇关于如何更改用Chartkick创建的柱形图的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文