I want to display data using chartkick in rails. My data structure is very simple.
//Table Drinks
Created_at Water (in l) Beer (in l) Coffee (in l)
21/02/2016 1 2 1
20/02/2016 2 1 0
19/02/2016 2 2 2
...
I want to draw three line charts. Each line chart should show the days on the x-axis and the amount of liters on the y-axis (one chart for each kind of drink).
I am just too confused to figure out how to do the right queries.
<%= line_chart ?????????? %>
Here is the link to the chartkick github repo: https://github.com/ankane/chartkick
Any help is very much appreciated!