お知らせ:
2025 年 4 月 15 日より前に Earth Engine の使用を登録したすべての非商用プロジェクトは、Earth Engine へのアクセスを維持するために
非商用目的での利用資格を確認する必要があります。
ui.Chart.setChartType
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
このグラフの chartType を設定します。
このグラフを返します。
用途 | 戻り値 |
---|
Chart.setChartType(chartType) | ui.Chart |
引数 | タイプ | 詳細 |
---|
これ: ui.chart | ui.Chart | ui.Chart インスタンス。 |
chartType | 文字列 | グラフの種類(例: 「ScatterChart」、「LineChart」、「ColumnChart」)。グラフの完全なリストについては、https://developers.google.com/chart/interactive/docs/gallery をご覧ください。 |
例
コードエディタ(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'));
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 UTC。"],[[["\u003cp\u003e\u003ccode\u003esetChartType\u003c/code\u003e defines the visual representation of data in a ui.Chart, such as 'ScatterChart', 'LineChart', or 'ColumnChart'.\u003c/p\u003e\n"],["\u003cp\u003eThis function is called on a ui.Chart instance and takes a string argument representing the desired chart type.\u003c/p\u003e\n"],["\u003cp\u003eCalling \u003ccode\u003esetChartType\u003c/code\u003e returns the modified ui.Chart, enabling method chaining for further customization.\u003c/p\u003e\n"],["\u003cp\u003eA comprehensive list of supported chart types is available in the Google Charts documentation (linked in the details).\u003c/p\u003e\n"],["\u003cp\u003eThe provided examples demonstrate how to apply different chart types to a data table using \u003ccode\u003esetChartType\u003c/code\u003e.\u003c/p\u003e\n"]]],["The `setChartType` method sets the type of a `ui.Chart` instance and returns the modified chart. It accepts a string argument (`chartType`) that specifies the desired chart type, such as 'ScatterChart', 'LineChart', or 'ColumnChart'. A data table is used to exemplify different chart types. Various chart examples include scatter, line, column, bar, pie, area and tables, and the complete list of chart types is found in the provided url.\n"],null,["# ui.Chart.setChartType\n\n\u003cbr /\u003e\n\nSets the chartType of this chart.\n\n\u003cbr /\u003e\n\nReturns this chart.\n\n| Usage | Returns |\n|---------------------------------|----------|\n| Chart.setChartType`(chartType)` | ui.Chart |\n\n| Argument | Type | Details |\n|------------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `ui.chart` | ui.Chart | The ui.Chart instance. |\n| `chartType` | String | The chart type; e.g 'ScatterChart', 'LineChart', and 'ColumnChart'. For the complete list of charts, see: https://developers.google.com/chart/interactive/docs/gallery |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// A data table of population for selected states.\nvar dataTable = [\n [{role: 'domain', label: 'State'}, {role: 'data', label: 'Population'}],\n ['CA', 37253956],\n ['NY', 19378102],\n ['IL', 12830632],\n ['MI', 9883640],\n ['OR', 3831074],\n];\n\n// Chart the data using accepted chart types.\nprint('Scatter chart', ui.Chart(dataTable).setChartType('ScatterChart'));\nprint('Line chart', ui.Chart(dataTable).setChartType('LineChart'));\nprint('Column chart', ui.Chart(dataTable).setChartType('ColumnChart'));\nprint('Bar chart', ui.Chart(dataTable).setChartType('BarChart'));\nprint('Pie chart', ui.Chart(dataTable).setChartType('PieChart'));\nprint('Area chart', ui.Chart(dataTable).setChartType('AreaChart'));\nprint('Table', ui.Chart(dataTable).setChartType('Table'));\n```"]]