You should return formatted Date objects from the getMonths function, 
instead of returning a string:

var result = google.visualization.data.group(
    data,
    [{ column: 0, modifier: getMonths, type: 'date'}],
    [{ 'column': 1, 'aggregation': google.visualization.data.sum, 'type': 
'number' }, { 'column': 2, 'aggregation': google.visualization.data.sum, 
'type': 'number'}]
);

function getMonths(someDate) {
    var month = someDate.getMonth();
    var year = someDate.getFullYear();
    return {v: new Date(year, month), f: (month + 1) + '/' + year};
}

You must specify each column individually, even if they use the same 
aggregation function.

On Thursday, September 18, 2014 2:10:06 AM UTC-4, Shivani Kanakhara wrote:
>
> Also while specifying columns in data.group , is there a way to specify 
> all column together having same aggregation?
> E.g
>
> var result = google.visualization.data.group(
>               data,
>               [{ column: 0, modifier: getMonths, type: 'string'}],
>               [{ 'column': 1, 'aggregation': 
> google.visualization.data.sum, 'type': 'number' }, { 'column': 2, 
> 'aggregation': google.visualization.data.sum, 'type': 'number'}]
>             );
>
> here column 1 and column 2 have same values for aggregation and type..so 
> can we write it as:
>
> [{ 'column': [1,2], 'aggregation': google.visualization.data.sum, 'type': 
> 'number' }]
>
> or do we have to explicitly specify all properties for each columns?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to