How to create a multi-line chart in GEE? Take the time series chart of temperature, wind speed and air pressure in meteorological data as an example

Simple time series chart

We first use the time series charting function ui.Chart.image.series(), which allows you to create a time series chart from a collection of images in a single location. You get a time series for each band of the input dataset. We take the TerraClimate data set as an example and select the highest and lowest monthly temperature bands. The resulting chart is a line chart and can be further customized using the .setOptions() method.

The following are the customization options that apply to the default time series chart:

lineWidth: Set the line thickness
pointSize: Set the size of the data points
title: Set the chart title
vAxis: Set the Y-axis options. Axis labels are specified using the title option.
hAxis: Set X-axis options. Use the gridlines option to specify grid lines. Use the format option to specify the date format for tick labels.
series: Set options for each individual time series. Series counting starts from 0.

function

ui.Chart.image.series(imageCollection, region, reducer, scale, xProperty)
Generates a Chart from an ImageCollection. Plots derived values of each band in a region across images. Usually a time series.

X-axis: Image, labeled by xProperty value.

Y-axis: Band value.

Series: Band names.

Returns a chart.

Arguments:
imageCollection (ImageCollection):
An ImageCollection with data to be included in the chart.

region (Feature|FeatureCollection|Geometry):
The region to reduce.

reducer (Reducer, optional):
Reducer that generates the values for the y-axis. Must return a single value. Defaults to ee.Reducer.mean().

scale (Number, optional):
Scale to use with the reducer in meters.

xProperty (String, optional):
Property to be used as the label for each image on the x-axis. Defaults to ‘system:time_start’.

Returns: ui.Chart

code

// 选择一个点作为研究区
var geometry = ee.Geometry.Point([116.395, 39.711]);

// 使用气象数据
var terraclimate = ee.ImageCollection('IDAHO_EPSCOR/TERRACLIMATE');

// 选择制定的4个波段

var temp = terraclimate.select(['tmmx', 'tmmn','vpd','vs']);

// The pixel values have a scale factor of 0.1
//这里我们进行温度转换转化为摄氏度,同样的所选的其他波段也进行了缩放
var tempScaled = temp.map(function(image

Guess you like

Origin blog.csdn.net/qq_31988139/article/details/133112968