ui.Chart.setChartType
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
نمودار نوع این نمودار را تنظیم می کند.
این نمودار را برمی گرداند.
| استفاده | برمی گرداند | Chart. setChartType (chartType) | ui.Chart |
| استدلال | تایپ کنید | جزئیات | این: ui.chart | ui.Chart | نمونه ui.Chart. |
chartType | رشته | نوع نمودار؛ به عنوان مثال 'ScatterChart'، 'LineChart' و 'ColumnChart'. برای لیست کامل نمودارها، به آدرس زیر مراجعه کنید: https://developers.google.com/chart/interactive/docs/gallery |
نمونه ها
ویرایشگر کد (جاوا اسکریپت)
// 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'));
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[],["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"]]