asTableChart()

Return

build()

Builds the chart to reflect all changes made to it.

This method does not automatically draw the chart on top of the spreadsheet. A new chart
must be inserted via sheet.insertChart(chart), and an existing chart should be updated
via sheet.updateChart(chart).

Return

Range[] — an array of ranges that serve as the chart to be built's data source

removeRange(range)

Removes the specified range from the chart this builder modifies. Does not throw an error if
the range is not in this chart.

The range removed must match up with a range added via addRange(range);
otherwise no change is made to the chart. This method cannot be used to partially remove values
from a range.

var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var firstRange = sheet.getRange("A1:B5");
var secondRange = sheet.getRange("A6:B8");
var chartBuilder = sheet.newChart()
.setChartType(Charts.ChartType.BAR)
.addRange(firstRange)
// This range will render in a different color
.addRange(secondRange)
.setPosition(5, 5, 0, 0);
// Note that you can use either of these two formats, but the range
// MUST match up with a range that was added via addRange(), or it
// will not be removed, and will not throw an exception
chartBuilder.removeRange(firstRange);
chartBuilder.removeRange(sheet.getRange("A6:B8"));
var chart = chartBuilder.build();
sheet.insertChart(chart);

Parameters

Return

reverseCategories()

Reverses the drawing of series in the domain axis. For vertical-range charts (such as line,
area or column charts), this means the horizontal axis is drawn from right to left. For
horizontal-range charts (such as bar charts), this means the vertical axis is drawn from top to
bottom. For pie charts, this means the slices are drawn counterclockwise.

Return

useLogScale()

Makes the range axis into a logarithmic scale (requires all values to be positive). The range
axis are the vertical axis for vertical charts (such as line, area, or column) and the
horizontal axis for horizontal charts (such as bar).