- X 軸:圖片,以 xProperty 值標示。
- Y 軸:參考區間值。
- 系列:樂團名稱。
傳回圖表。
用量 | 傳回 |
---|---|
ui.Chart.image.series(imageCollection, region, reducer, scale, xProperty) | ui.Chart |
引數 | 類型 | 詳細資料 |
---|---|---|
imageCollection | ImageCollection | 包含要納入圖表資料的 ImageCollection。 |
region | Feature|FeatureCollection|Geometry | 要縮減的區域。 |
reducer | 縮減函式 (選用) | 產生 y 軸值的 Reducer。必須傳回單一值。預設為 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);