我在 Rails 4.1 中使用 chartkick,但出于某种原因我无法更改背景图片!
我的配置文件设置了除背景透明度之外的所有内容。任何帮助都会非常好。
我的配置文件:
Chartkick.options = { library: { legend: { enabled: true }, exporting: { enabled: false }, backgroundColor: "transparent", height: "300px", width: "200px", colors: ["#2c3e50", "#2980b9", "#e74c3c", "#c0392b"] } }
谢谢!!
最佳答案
如果您使用 google charts使用 Chartkik,您不能在该属性上使用透明。您可以查看有关各个图表选项的文档,例如 PieChart 上的此处:
backgroundColor
- The background color for the main area of the chart. Can be either a simple HTML color string, for example: 'red' or '#00cc00', or an object with the following properties:
- backgroundColor.stroke: The color of the chart border, as an HTML color string.
- backgroundColor.strokeWidth: The border width, in pixels.
- backgroundColor.fill: The chart fill color, as an HTML color string.
关于ruby-on-rails - 使用 Chartkick 时无法摆脱背景图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26040980/