I tried to generate a time series chart of NDVI using Sentinel-2 data for multiple points. But the chart has vertical plots with two values for same point and same date.
Here is the code:
var points = ee.FeatureCollection([
ee.Feature(geometry2, {label: 'm1'}),
ee.Feature(geometry3, {label: 'm2'}),
ee.Feature(geometry4, {label: 'm3'}),
ee.Feature(geometry5, {label: 'm4'}),
ee.Feature(geometry6, {label: 'm5'}),
ee.Feature(geometry7, {label: 'm6'}),
ee.Feature(geometry8, {label: 'm7'}),
ee.Feature(geometry9, {label: 'm8'}),
ee.Feature(geometry10, {label: 'm9'}),
ee.Feature(geometry11, {label: 'm10'})
]);
Map.addLayer(points);
// NDVI calculation
var addNDVI = function(image) {
return image.addBands(image.normalizedDifference(['B8', 'B4']));
};
var with_ndvi = puli.map(addNDVI);
var rgb_vis = {min: 0, max: 5000, bands: ['B4', 'B3', 'B2']};
Map.addLayer(puli, rgb_vis, 'RGB');
Map.addLayer(with_ndvi, {bands: 'nd', min: 0, max: 1}, 'NDVI');
// Time Series Analysis for NDVI
var TimeSeriesndvi = ui.Chart.image.seriesByRegion(with_ndvi,points,ee.Reducer.mean(),'nd',200, 'system:time_start', 'label')
.setChartType('ScatterChart')
.setOptions({
title: 'NDVI variations',
vAxis: {title: 'NDVI'},
lineWidth: 1,
pointSize: 4,
series: {
// 0: {color: 'FF0000'},
// 1: {color: '00FF00'},
// 2: {color: '0000FF'},
}});
print(TimeSeriesndvi);