Hi, We are aware that the grouping function can be optimized for cases where the input has modifier functions on the keys. We may have a fix to that in the next versions of the API.
In the meantime, you can try running the modifier function on the input yourself before passing it to the grouping function. Also, can you please provide the name/version of the browsers where this becomes a problem? Cheers, VizWiz On Thu, Oct 15, 2009 at 4:18 PM, magila <[email protected]> wrote: > > I created a custom modifier for the group key that truncates a > datetime field to 15 minute intervals and it gets called more than I > expect. This is OK with firefox and chrome, but with browsers that > don't like long running javascript, it is becoming a problem. The > modifier seems to be called ((NumberOfRows of the input datatable)-1) > *5 + (NumberOfRows of Resultant datatable) + 1 > > If I get 1631 rows from a query against a google spreadsheet and it > results in 802 keys, my modifier function gets called 8953 times! > > Is this expected? Is there a more efficient way to do this? > > Below are the snippets of javascript > > var timeGroupedData = google.visualization.data.group(data,[{'column': > 0, 'modifier':whichQuarterHour, 'type':'datetime'}],[{'column': 0, > 'aggregation': google.visualization.data.count, 'type': 'number'}]); > > function whichQuarterHour(someDate) { > someDate.setMinutes(Math.floor(someDate.getMinutes()/15) * 15); > someDate.setSeconds(0); > someDate.setMilliseconds(0); > gqcounter +=1; > return someDate; > } > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en -~----------~----~----~----~------~----~------~--~---
