I am creating a chart that takes the averages of the first 5 columns and stores the averages into an "Average" Column. How would implement this?
I was able to store average of column 1 following this example: // Aggregate the previous view to calculate the average. This table should be a single table that looks like: // [['', AVERAGE]], so you can get the Average with .getValue(0,1) var group = google.visualization.data.group(viewWithKey, [2], [{ column: 1, id: 'avg', label: 'average', aggregation: google.visualization.data.avg, 'type': 'number' }]); // Create a DataView where the third column is the average. var dv = new google.visualization.DataView(data); dv.setColumns([0, 1, { type: 'number', label: 'average', calc: function (dt, row) { return group.getValue(0, 1); } }]); But how would I accomplish this for columns 2-6? -- You received this message because you are subscribed to the Google Groups "Google Chart API" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-chart-api+unsubscr...@googlegroups.com. To post to this group, send email to google-chart-api@googlegroups.com. Visit this group at https://groups.google.com/group/google-chart-api. For more options, visit https://groups.google.com/d/optout.