ui.Chart.setChartType

Définit le chartType de ce graphique.

Renvoie ce graphique.

UtilisationRenvoie
Chart.setChartType(chartType)ui.Chart
ArgumentTypeDétails
ceci : ui.chartui.ChartInstance ui.Chart.
chartTypeChaîneType de graphique (par exemple, "ScatterChart", "LineChart" et "ColumnChart"). Pour obtenir la liste complète des graphiques, consultez la page https://developers.google.com/chart/interactive/docs/gallery.

Exemples

Éditeur de code (JavaScript)

// A data table of population for selected states.
var dataTable = [
  [{role: 'domain', label: 'State'}, {role: 'data', label: 'Population'}],
  ['CA', 37253956],
  ['NY', 19378102],
  ['IL', 12830632],
  ['MI', 9883640],
  ['OR', 3831074],
];

// Chart the data using accepted chart types.
print('Scatter chart', ui.Chart(dataTable).setChartType('ScatterChart'));
print('Line chart', ui.Chart(dataTable).setChartType('LineChart'));
print('Column chart', ui.Chart(dataTable).setChartType('ColumnChart'));
print('Bar chart', ui.Chart(dataTable).setChartType('BarChart'));
print('Pie chart', ui.Chart(dataTable).setChartType('PieChart'));
print('Area chart', ui.Chart(dataTable).setChartType('AreaChart'));
print('Table', ui.Chart(dataTable).setChartType('Table'));