Chartkick Graph Accumulate values
Using Rails, Chartkick and Groupdate I have a graph which shows values.
In the view:
<%= line_chart @ContractsForChart.group_by_month(:contract_date).sum(:units), xtitle: "Months", ytitle: "Units Sold" %>
In the controller:
@ContractsForChart = Contract.joins(:store)
I would like the values (the units) to accumulate, how could I do this please?