Jeff
Jeff

Reputation: 1800

Group by month - Google bar chart

I have a google bar chart here:

http://jsfiddle.net/jeag1gva/1/

What I want to do is group the costs for each month, so the chart would be:

January: Sum of all costs in january, Februray: Sum of all costs in february .. you get the idea

I figured the query:

query.setQuery("select A, sum(C) group by A ");

would add up all the numbers in C the C column, and return them, but that doesn't work.

I haven't had any luck with formatters either.

Has anyone done this before?

The resulting chart would look something similar to this: enter image description here

except it'd only have one bar on the horizontal axis.

Upvotes: 2

Views: 1380

Answers (1)

gar
gar

Reputation: 14550

Changing the query to query.setQuery("select min(A), sum(C) group by month(A)"); aggregates the costs per month.

The formatter seems to be being applied. What's the issue you're seeing with it?

Upvotes: 2

Related Questions