ui.Chart.image.seriesByRegion

สร้างแผนภูมิจากคอลเล็กชันรูปภาพ ดึงข้อมูลและพล็อตค่าของแถบที่ระบุในแต่ละภูมิภาคสำหรับแต่ละรูปภาพในคอลเล็กชัน โดยปกติจะเป็นอนุกรมเวลา

  - แกน X = รูปภาพที่ติดป้ายกำกับโดย xProperty (ค่าเริ่มต้น: 'system:time_start')

  - แกน Y = เอาต์พุตของตัวลด

  - Series = ภูมิภาคที่ติดป้ายกำกับโดย seriesProperty (ค่าเริ่มต้น: "system:index")

แสดงผลแผนภูมิ

การใช้งานการคืนสินค้า
ui.Chart.image.seriesByRegion(imageCollection, regions, reducer, band, scale, xProperty, seriesProperty)ui.Chart
อาร์กิวเมนต์ประเภทรายละเอียด
imageCollectionImageCollectionImageCollection ที่มีข้อมูลที่จะรวมไว้ในแผนภูมิ
regionsFeature|FeatureCollection|Geometry|List<Feature>|List<Geometry>ภูมิภาคที่จะลด
reducerตัวลดตำแหน่งตัวลดที่สร้างค่าสำหรับแกน y ต้องแสดงค่าเดียว
bandNumber|String, ไม่บังคับชื่อวงดนตรีที่จะลดโดยใช้ตัวลด ค่าเริ่มต้นคือแถบแรก
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);