使用Chartkick时无法摆脱背景图片

时间:2014-09-25 14:20:16

标签: ruby-on-rails charts chartkick

我在rails 4.1中使用了chartkick,由于某种原因我不能改变背景图像!

我的配置文件实现了除背景透明度之外的所有内容。任何帮助都会非常好。

我的配置文件:

  

Chartkick.options = {       图书馆: {         图例:{enabled:true},         导出:{enabled:false},         backgroundColor:“透明”,         身高:“300px”,         宽度:“200px”,         颜色:[“#2c3e50”,“#2980b9”,“#e74c3c”,“#c0392b”]       }   }

谢谢!

1 个答案:

答案 0 :(得分:1)

如果您对Chartkik使用google charts,则无法在该属性上使用透明。您可以查看各个图表选项的文档,例如PieChart

  

backgroundColor

     
      
  • 图表主要区域的背景颜色。可以是简单的HTML颜色字符串,例如:'red'或'#00cc00',或者   具有以下属性的对象:   
        
    • backgroundColor.stroke:图表边框的颜色,作为HTML颜色字符串。
    •   
    • backgroundColor.strokeWidth:边框宽度(以像素为单位)。
    •   
    • backgroundColor.fill:图表填充颜色,作为HTML颜色字符串。
    •   
  •   
相关问题