ui.Chart.image.seriesByRegion

画像コレクションからグラフを生成します。コレクション内の各画像の各リージョンで指定されたバンドの値を抽出し、プロットします。通常は時系列です。

  - X 軸 = xProperty でラベル付けされた画像(デフォルト: 'system:time_start')。

  - Y 軸 = Reducer の出力。

  - Series = seriesProperty でラベル付けされたリージョン(デフォルト: 'system:index')。

グラフを返します。

用途戻り値
ui.Chart.image.seriesByRegion(imageCollection, regions, reducer, band, scale, xProperty, seriesProperty)ui.Chart
引数タイプ詳細
imageCollectionImageCollectionグラフに含めるデータを含む ImageCollection。
regionsFeature|FeatureCollection|Geometry|List<Feature>|List<Geometry>削減するリージョン。
reducerレデューサY 軸の値を生成するリデューサー。単一の値を返す必要があります。
band数値|文字列、省略可リデューサーを使用して削減するバンド名。デフォルトは最初のバンドです。
scale数値、省略可リデューサーで使用するスケール(メートル単位)。
xProperty文字列、省略可X 軸の各画像のラベルとして使用するプロパティ。デフォルトは「system:time_start」です。
seriesProperty文字列、省略可系列ラベルに使用する opt_regions の特徴のプロパティ。デフォルトは「system:index」です。

コードエディタ(JavaScript)

// Define regions of pixels to reduce and chart a time series for.
var regions = ee.FeatureCollection([
  ee.Feature(
    ee.Geometry.BBox(-121.916, 37.130, -121.844, 37.076), {label: 'Forest'}),
  ee.Feature(
    ee.Geometry.BBox(-122.438, 37.765, -122.396, 37.800), {label: 'Urban'})
]);

// 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.seriesByRegion({
  imageCollection: imgCol,
  band: 'NDVI',
  regions: regions,
  reducer: ee.Reducer.mean(),
  scale: 500,
  seriesProperty: 'label',
  xProperty: 'system:time_start'
})
.setOptions({
  title: 'Average NDVI Value by Date',
  hAxis: {title: 'Date', titleTextStyle: {italic: false, bold: true}},
  vAxis: {
    title: 'NDVI (x1e4)',
    titleTextStyle: {italic: false, bold: true}
  },
  lineWidth: 5,
  colors: ['0f8755', '808080'],
});
print(chart);