1

我正在为 Ruby 使用googlecharts gem。我想绘制具有不同列颜色和垂直轴范围的汽车的直方图。不知何故,所有列都具有相同的颜色,并且轴标签也不起作用。我的错误在哪里?

 <%= image_tag(Gchart.bar :size => '340x260', 
                   :title => 'Car Types',
                   :data => [5,1,10],
                   :legend => ['BWM','Audi','Opel'],
                   :bar_colors => '3300CC,3399FF,33CCFF',
                   :axis_with_labels =>'y',                   
                   :axis_labels =>[0,10]



                   ) %>

提前致谢

4

1 回答 1

2

这对我来说很好:

<%= image_tag(Gchart.bar :size => '340x260', 
                   :stacked => false,
                   :title => 'Car Types',
                   :data => [[5],[1],[10]],
                   :legend => ['BWM','Audi','Opel'],
                   :bar_colors => ['3300CC','3399FF','33CCFF'],
                   :axis_with_labels => ['y'],                   
                   :axis_labels => [[0,10]]
                   ) %>
于 2013-02-09T07:37:42.043 回答