Feature Groups Charts

If the features to be charted have a property that defines groups, use ui.Chart.feature.groups() to plot each group as a different series. In the following example, first a group is defined based on an existing property, then a ui.Chart is made using the two groups:

// Import US state boundaries.
var states = ee.FeatureCollection('TIGER/2018/States');

// Import temperature normals and convert month features to bands.
var normClim = ee.ImageCollection('OREGONSTATE/PRISM/Norm81m')
  .select(['tmean'])
  .toBands();

// Calculate mean monthly temperature per state.
states = normClim.reduceRegions({
  collection: states,
  reducer: ee.Reducer.mean(),
  scale: 5e4})
  .filter(ee.Filter.notNull(['01_tmean']));

// Define groups in the data by mapping a function to set a new property.
var grouped = states.map(function(feature) {
  var skiable = ee.Number(feature.get('01_tmean')).lte(0);
  return feature.set('skiing', skiable);
});

// Create the chart.
var chart = ui.Chart.feature.groups(
    grouped, '01_tmean', '07_tmean', 'skiing'
  )
  .setChartType('ScatterChart')
  .setOptions({
    hAxis: {title: 'Average January Temperature (C)'},
    vAxis: {title: 'Average July Temperature (C)'},
  }).setSeriesNames(["ski", "don't ski"]);

// Print the chart.
print(chart);

The result should look something like Figure 1.

ui.Chart.feature.groups
Figure 1. Features plotted by groups, where the groups are defined by mean temperature in January.