2

In the chart editor there is an option to "Aggregate Column A".

How can I set this in a script using setOption?

Thanks

Antony Denyer
  • 1,541
  • 1
  • 15
  • 31
  • You want to use `setOption` from an AppScript service (eg. `EmbeddedChartService`) and use [Data Manipulation Methods](https://developers.google.com/chart/interactive/docs/reference#data-manipulation-methods) to Google Visualization API? You can use the `join()` method to 2 `DataTables` or if you're SQL-savvy, the `group()` method would do. – adjuremods Apr 24 '16 at 22:58
  • Thanks @adjuremods the data is already manipulated how I want. I was hoping that there would something easier to work with. Basically what's happening is the chart is creating a series when I have a fixed list of discrete values. i.e `Val Sum 1000 111 500 555 300 7 100 66 ` Then the chart shows 0 values for 200, 400 etc.. – Antony Denyer Apr 25 '16 at 09:13

1 Answers1

3

After reverse engineering the code created from the graph using the method described here https://stackoverflow.com/a/13652972

I found that the option to achieve the same as "Aggregate column a" is

.setOption('applyAggregateData',0)

It makes zero sense with the 0 and such but considering how badly some of the Gapps Script stuff is, im not surprised.