I'm trying to create a chart of NDVI values that shows the average values for each day of the year for the last 5 years. I think exactly what I need is this: https://developers.google.com/earth-engine/guides/charts_image_collection#uichartimagedoyseriesbyregion
But if I insert a custom feature.collection with two points selected, it only shows one line in the chart, not two. What is the problem?
var pts = ee.FeatureCollection("users/petrjanos/hlavni/random_points");
// Load MODIS vegetation indices data and subset a decade of images.
var vegIndices = ee.ImageCollection('MODIS/006/MOD13A1')
.filter(ee.Filter.date('2010-01-01', '2020-01-01'))
.select(['NDVI', 'EVI']);
// Define the chart and print it to the console.
var chart = ui.Chart.image
.doySeriesByRegion({
imageCollection: vegIndices,
bandName: 'NDVI',
regions: pts,
regionReducer: ee.Reducer.mean(),
scale: 500,
//yearReducer: ee.Reducer.mean(),
seriesProperty: 'label',
startDay: 1,
endDay: 365
})
.setOptions({
title: 'Average NDVI Value by Day of Year',
hAxis: {
title: 'Day of year',
titleTextStyle: {italic: false, bold: true}
},
vAxis: {
title: 'NDVI (x1e4)',
titleTextStyle: {italic: false, bold: true}
},
lineWidth: 5,
colors: ['f0af07', '0f8755', '76b349'],
});
print(chart);
My feature collection: https://code.earthengine.google.com/?asset=users/petrjanos/hlavni/random_points