ui.Chart.image.series

根据 ImageCollection 生成图表。绘制区域中每个波段在不同图片中的派生值。通常是时间序列。

  - X 轴:图片,由 xProperty 值标记。

- Y 轴:频段值。

  - 系列:频段名称。

返回图表。

用法返回
ui.Chart.image.series(imageCollection, region, reducer, scale, xProperty)ui.Chart
参数类型详细信息
imageCollectionImageCollection包含要纳入图表中的数据的 ImageCollection。
regionFeature|FeatureCollection|Geometry要缩减的区域。
reducerReducer,可选用于生成 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);