Builds the chart.
Sets the background color for the chart.
Sets the colors for the lines in the chart.
Sets the data source URL that will be used to pull data in from an external source, such as Google Sheets.
Sets the data source URL that will be used to pull data in from an external source, such as Google Sheets. If a data source URL and a DataTable are provided, the data source URL is ignored. For more information about querying data sources, check out the Google Charts documentation.
Sets the data table which contains the lines for the chart, as well as the X-axis labels.
Sets the data table which contains the lines for the chart, as well as the X-axis labels. The first column should be a string, and contain the horizontal axis labels. Any number of columns can follow, all must be numeric. Each column is displayed as a separate line.
Sets the data table to use for the chart using a DataTableBuilder.
Sets the data table to use for the chart using a DataTableBuilder. This is a convenience method for setting the data table without needing to call build().
Sets the data view definition to use for the chart.
Sets the dimensions for the chart.
Sets the position of the legend with respect to the chart.
Sets the position of the legend with respect to the chart. By default, there will be no legend.
Sets the text style of the chart legend.
Sets the style for points in the line.
Sets the style for points in the line. By default, points will have no particular styles, and only the line will be visible.
Sets the title of the chart.
Sets the title of the chart. The title will be displayed centered above the chart.
Sets the text style of the chart title.
Makes the horizontal axis into a logarithmic scale (requires all values to be positive).
Sets the range for the horizontal axis of the chart.
Sets the horizontal axis text style.
Adds a title to the horizontal axis.
Adds a title to the horizontal axis. The title will be centered and will appear below the axis value labels.
Sets the horizontal axis title text style.
Makes the vertical axis into a logarithmic scale (requires all values to be positive).
Sets the range for the vertical axis of the chart.
Sets the range for the vertical axis of the chart. If any data points fall outside the range, the range will be expanded to include those data points.
Sets the vertical axis text style.
Adds a title to the vertical axis.
Adds a title to the vertical axis. The title will be centered and will appear to the left of the value labels.
Sets the vertical axis title text style.
ScatterChartBuilder Builder for scatter charts. For more details, see the Google Charts documentation. Here is an example that shows how to build a scatter chart. The data is imported from a Google spreadsheet.
function doGet() { // Get sample data from a spreadsheet. var dataSourceUrl = 'https://docs.google.com/spreadsheet/tq?range=C1%3AD' + '&key=0Aq4s9w_HxMs7dHpfX05JdmVSb1FpT21sbXd4NVE3UEE&gid=4&headers=-1';
var chartBuilder = Charts.newScatterChart() .setTitle('Adjusted GDP vs. U.S. Population') .setXAxisTitle('U.S. Population (millions)') .setYAxisTitle('Adjusted GDP ($ billions)') .setDimensions(600, 500) .setLegendPosition(Charts.Position.NONE) .setDataSourceUrl(dataSourceUrl);
var chart = chartBuilder.build(); return UiApp.createApplication().add(chart); }