Chart Overview
Reference: https://developers.google.com/earth-engine/guides/charts_feature#column_chart
import ee
import geemap
import geemap.chart as chart
# geemap.update_package()
Reference: https://developers.google.com/earth-engine/guides/charts_feature#uichartfeaturebyfeature
Map = geemap.Map()
features = ee.FeatureCollection('projects/google/charts_feature_example') \
.select('[0-9][0-9]_tmean|label')
Map.addLayer(features, {}, "Ecoregions")
Map
df = geemap.ee_to_pandas(features)
df
xProperty = "label"
yProperties = [str(x).zfill(2) + "_tmean" for x in range(1, 13)]
labels = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
colors = ['#604791', '#1d6b99', '#39a8a7', '#0f8755', '#76b349', '#f0af07',
'#e37d05', '#cf513e', '#96356f', '#724173', '#9c4f97', '#696969']
title = "Average Monthly Temperature by Ecoregion"
xlabel = "Ecoregion"
ylabel = "Temperature"
options = {"labels": labels,
"colors": colors,
"title": title,
"xlabel": xlabel,
"ylabel": ylabel,
"legend_location": "top-left",
"height": "500px"}
chart.feature_byFeature(features, xProperty, yProperties, **options)
Reference: https://developers.google.com/earth-engine/guides/charts_feature#uichartfeaturebyproperty
Map = geemap.Map()
features = ee.FeatureCollection('projects/google/charts_feature_example') \
.select('[0-9][0-9]_ppt|label')
Map.addLayer(features, {}, 'Features')
Map
df = geemap.ee_to_pandas(features)
df
keys = [str(x).zfill(2) + "_ppt" for x in range(1, 13)]
values = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
xProperties = dict(zip(keys, values))
seriesProperty = "label"
options = {
'title': "Average Ecoregion Precipitation by Month",
'colors': ['#f0af07', '#0f8755', '#76b349'],
'xlabel': "Month",
'ylabel': "Precipitation (mm)",
'legend_location': "top-left",
"height": "500px"
}
chart.feature_byProperty(features, xProperties, seriesProperty, **options)