1

I created a Bubble Chart manually on the spreadsheet and I can see it. But I can't reach it by script. sheet.getCharts() doesn't return my Bubble Chart (but I see other charts)

/* OnOpen Trigger modifying an existing (embedded) chart */
function onOpen (e) {
  try {
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var sheet = ss.getSheets()[0];
    var bubbleChart = null;

    var charts = sheet.getCharts();

    debugger

    for (var i in charts) {
      Logger.log(charts[i].getOptions().get('title'));
    }

  } catch (err) {
    Logger.log(err.toString());
  }
}

enter image description here

2
  • Have you tried logging the length of charts? You could also use an explicit loop rather than for...in (here's an explainer). Commented Nov 9, 2017 at 12:56
  • I added a screenshot from a debugger. charts[4] [EmbeddedChart, EmbeddedChart, EmbeddedChart, EmbeddedChart] should have 5 EmbeddedCharts! Commented Nov 9, 2017 at 13:04

2 Answers 2

1

This appears to be a bug in apps script. It is referenced in a thread dating back to May of this year regarding timeline charts. I have opened a new bug report with Google.

Sign up to request clarification or add additional context in comments.

2 Comments

Only a question: A Timeline charts have the same issue?
0

From my point of view Google doesn't respect Bubble Chart!

sheet.getCharts() ignores Bubble Charts!

EmbeddedBubbleChartBuilder doesn't exist! and EmbeddedScatterChartBuilder doesn't care about sizeAxis option.

ChartType doesn't contain BUBBLE value: Enum ChartType | Apps Script

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.