公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ui.Chart.image.series
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
根据 ImageCollection 生成图表。绘制区域中每个波段在不同图片中的派生值。通常是时间序列。
- X 轴:图片,由 xProperty 值标记。
- Y 轴:频段值。
- 系列:频段名称。
返回图表。
用法 | 返回 |
---|
ui.Chart.image.series(imageCollection, region, reducer, scale, xProperty) | ui.Chart |
参数 | 类型 | 详细信息 |
---|
imageCollection | ImageCollection | 包含要纳入图表中的数据的 ImageCollection。 |
region | Feature|FeatureCollection|Geometry | 要缩减的区域。 |
reducer | Reducer,可选 | 用于生成 y 轴值的精简器。必须返回单个值。默认值为 ee.Reducer.mean()。 |
scale | 数字,可选 | 用于与缩减器搭配使用的缩放比例(以米为单位)。 |
xProperty | 字符串,可选 | 用作 x 轴上每张图片的标签的属性。默认值为“system:time_start”。 |
示例
代码编辑器 (JavaScript)
// Define a region of pixels to reduce and chart a time series for.
var region = ee.Geometry.BBox(-121.916, 37.130, -121.844, 37.076);
// Define an image collection time series to chart, MODIS vegetation indices
// in this case.
var imgCol = ee.ImageCollection('MODIS/006/MOD13A1')
.filter(ee.Filter.date('2015-01-01', '2020-01-01'))
.select(['NDVI', 'EVI']);
// Define the chart and print it to the console.
var chart = ui.Chart.image.series({
imageCollection: imgCol,
region: region,
reducer: ee.Reducer.mean(),
scale: 500,
xProperty: 'system:time_start'
})
.setSeriesNames(['EVI', 'NDVI'])
.setOptions({
title: 'Average Vegetation Index Value by Date',
hAxis: {title: 'Date', titleTextStyle: {italic: false, bold: true}},
vAxis: {
title: 'Vegetation index (x1e4)',
titleTextStyle: {italic: false, bold: true}
},
lineWidth: 5,
colors: ['e37d05', '1d6b99'],
curveType: 'function'
});
print(chart);
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eGenerates a chart visualizing the change in pixel values within a specified region across an image collection, often used for time series analysis.\u003c/p\u003e\n"],["\u003cp\u003eThe chart displays band values on the y-axis, images (labeled by a chosen property) on the x-axis, and uses separate series for each band.\u003c/p\u003e\n"],["\u003cp\u003eUsers can customize the chart by specifying the region, reducer, scale, and label property, with defaults provided for convenience.\u003c/p\u003e\n"],["\u003cp\u003eAn example using MODIS vegetation indices demonstrates the function's application in tracking vegetation changes over time.\u003c/p\u003e\n"]]],[],null,["# ui.Chart.image.series\n\n\u003cbr /\u003e\n\nGenerates a Chart from an ImageCollection. Plots derived values of each band in a region across images. Usually a time series.\n\n\u003cbr /\u003e\n\n- X-axis: Image, labeled by xProperty value.\n\n- Y-axis: Band value.\n\n- Series: Band names.\n\nReturns a chart.\n\n| Usage | Returns |\n|-------------------------------------------------------------------------------------------|----------|\n| `ui.Chart.image.series(imageCollection, region, `*reducer* `, `*scale* `, `*xProperty*`)` | ui.Chart |\n\n| Argument | Type | Details |\n|-------------------|--------------------------------------|--------------------------------------------------------------------------------------------------------------|\n| `imageCollection` | ImageCollection | An ImageCollection with data to be included in the chart. |\n| `region` | Feature\\|FeatureCollection\\|Geometry | The region to reduce. |\n| `reducer` | Reducer, optional | Reducer that generates the values for the y-axis. Must return a single value. Defaults to ee.Reducer.mean(). |\n| `scale` | Number, optional | Scale to use with the reducer in meters. |\n| `xProperty` | String, optional | Property to be used as the label for each image on the x-axis. Defaults to 'system:time_start'. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// Define a region of pixels to reduce and chart a time series for.\nvar region = ee.Geometry.BBox(-121.916, 37.130, -121.844, 37.076);\n\n// Define an image collection time series to chart, MODIS vegetation indices\n// in this case.\nvar imgCol = ee.ImageCollection('MODIS/006/MOD13A1')\n .filter(ee.Filter.date('2015-01-01', '2020-01-01'))\n .select(['NDVI', 'EVI']);\n\n// Define the chart and print it to the console.\nvar chart = ui.Chart.image.series({\n imageCollection: imgCol,\n region: region,\n reducer: ee.Reducer.mean(),\n scale: 500,\n xProperty: 'system:time_start'\n})\n.setSeriesNames(['EVI', 'NDVI'])\n.setOptions({\n title: 'Average Vegetation Index Value by Date',\n hAxis: {title: 'Date', titleTextStyle: {italic: false, bold: true}},\n vAxis: {\n title: 'Vegetation index (x1e4)',\n titleTextStyle: {italic: false, bold: true}\n },\n lineWidth: 5,\n colors: ['e37d05', '1d6b99'],\n curveType: 'function'\n});\nprint(chart);\n```"]]