I\'m using chartckick in my RoR project to generate charts, which works quite nice. (along with Google Charts).
I\'ve created a column chart with only 2 bars
The following also works. I didn't need any new files in initializers (no chartkick.rb file), this just worked by adding the following code to my helper file:
def networth_data
[
{name: "Assets", data: {"NetWorth": 6979.53}},
{name: "Liabilities", data: {"NetWorth": 10532.32}}
]
end
And then in my html.erb i specified the colors and other options I wanted:
<%= column_chart networth_data,
colors: ["green", "#FF0000"],
library: {backgroundColor: "#FFF", height: 265} %>
...renders this chart: