Gandom
Gandom

Reputation: 1

Error in create chart in google earth engine

I am trying to plot LST time series in Google earth engine but there is an error: " Error generating chart: No properties to chart." The code is below:

Map.centerObject(AOI);
Map.addLayer(AOI);
 
var LST_K = ee.ImageCollection("MODIS/006/MOD11A2")
.filterBounds(AOI)
.filterDate('2021-02-20','2021-06-01')
.map(function(img){
  return img.multiply(0.02).subtract(273.15)
  .copyProperties(img,['system:time_start','system:time_end']);
});

var LST=LST_K.select("LST_Day_1km","LST_Night_1km");
print('LST',LST);

var chart = ui.Chart.image.series(
 LST,AOI,ee.Reducer.median(),1000,'system:time_start'
  ).setChartType('ScatterChart')
  .setOptions({
    title : 'LST-Parcel No: 2406724',
    vAxis : {title : 'LST'},
    hAxis : {title : 'Date'},
    lineWidth : 2,
    pointSize : 3,
    series : {
      0 : {color : 'black'}
  }});
print(chart);

and the code link: https://code.earthengine.google.com/fc334567fb9ea02d568ac52e7bff9424

Many thanks in advance.

Upvotes: 0

Views: 1663

Answers (1)

mandal
mandal

Reputation: 11

Set the scale to lower values, as your study site seems to be very small.

 var chart = ui.Chart.image.series({
  imageCollection:  LST,
  region: AOI,
  reducer: ee.Reducer.median(),
  scale:100,
  //xProperty: 'system:time_start'  
})

print(chart);

https://code.earthengine.google.com/bbab81520e5357e4f26010292e107042

Upvotes: 1

Related Questions