eleven
eleven

Reputation: 6855

Custom chart without range

EmbeddedChartBuilder allows to set range out of sheet:

builder.addRange(sheet.getRange('A1:A2'))

Is there way to set chart data without a range? Something like this seems should be reasonable:

builder.setData([1, 2, 3])

Upvotes: 0

Views: 269

Answers (1)

TheMaster
TheMaster

Reputation: 50799

It is not possible to set values directly from a array to Embedded Chart builder.

Possible workarounds:

  • Charts service: Static Server side charts Use Charts class to create a datatable and use it to create a server side chart. This could then be inserted as a static image in the spreadsheet.

  • Html Charts: Live charts from Google viz Use (Google charts) to create a live html chart and show it in the sidebar/modal dialogs.

  • Google sheets range:
    Set the array to a range in sheets and add that range to embedded chart builder.

Upvotes: 2

Related Questions