Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I mix a column and line chart in Rails using Chartkick?

I would like to present graphs in my rails app. I was able to find a lot of projects that could do that, as Chartkick. But I would like to have charts like this one, where I max lines and columns. Is there any project that is able to draw this kind of graphs? I was not able to find anything on chartkick's website or Google.

like image 836
JSBach Avatar asked Mar 19 '14 20:03

JSBach


1 Answers

You could do it like this using chartkick:

= column_chart(@your_data, library: { :series => { 0 => { type: "line"} } })

This will set the first series in @your_data as the line chart. Of course you can set every other series in that as well just exchange the "0" for another number.

I hope this helps!

like image 173
tomr Avatar answered Oct 03 '22 14:10

tomr