Just had a look at calc cols, and that will work just fine. Thanks. [Request] Would be nice to have some built-ins for calculating avg, count, distinct count, sum etc. of a column (without grouping)
Appreciate all the work on this lib! On Oct 22, 4:06 pm, VizGuy <[email protected]> wrote: > I suppose what you are looking for is 'calculated columns' in data view.This > feature was introduced lately, using the setColumns method of data view > (seehttp://code.google.com/apis/visualization/documentation/reference.htm... > ). > > The usage is not super trivial, cause we wanted to build something powerful, > but it is not that complicated wither. See the example in the docs for more > details. > > Regards, > VizGuy > > > > On Thu, Oct 22, 2009 at 8:05 PM, europe72 <[email protected]> wrote: > > > Hello, wondering how I could create a DataView from the average of a > > column in a DataTable? I see that there is avg functionality by way > > of ...group, but I don't need to group by anything. Is there a flavor > > of dv.setRows() where I can pass in something similar to: {'column': > > 14, 'aggregation': google.visualization.data.avg, 'type': 'number'} > > e.g. > > > myNewDataView = new google.visualization.DataView(myDataTable) > > myNewDataView.setColumns([14]) > > myNewDataView.setRows([{'column': 14, 'aggregation': > > google.visualization.data.avg, 'type': 'number'}]) > > > ?? > > > Thanks in advance --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
