Save 36% for Black Friday! Learn more

New Discussion

Notifications

You’re not receiving notifications from this thread.

Chartkick Graph Accumulate values

0
Rails

Hi

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?

Simon

Join the discussion
Create an account Log in