Hey ,tried out your solution..the grouping of months works properly,but 
month labels are not displayed as specified in the format. Months are 
displayed as Jan 2012,Feb 2013....which is different from the format passed 
from the modifier function.

On Friday, September 19, 2014 6:25:28 AM UTC+5:30, Andrew Gallant wrote:
>
> 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 [email protected].
To post to this group, send email to [email protected].
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