This sample demonstrates how to organize several Elevation Profile component profile lines into ElevationProfileGroup objects. An ElevationProfileLineGround samples all ground layers as a single profile, so groups are useful when you want to separate the elevation sources that contribute to the chart. In this sample, one group compares the pre- and post-landslide Oso survey elevation layers, while a second group shows (in the chart only, not in the view) the default Terrain 3D as context.

arcgisElevationProfile.profiles = new Collection([
{
type: "group",
title: "Oso surveys",
profiles: new Collection([
{
type: "query",
title: "Pre-Landslide (March 2014)",
source: beforeLandslideLayer,
color: profileColors.beforeLandslide,
},
{
type: "query",
title: "Post-Landslide (April 2014)",
source: afterLandslideLayer,
color: profileColors.afterLandslide,
},
]),
},
{
type: "group",
title: "Regional context",
profiles: new Collection([
{
type: "query",
title: `${terrain3DLayer.title} (${new Date().getFullYear()})`,
source: terrain3DLayer,
color: profileColors.terrainContext,
viewOptions: {
lineVisible: false,
indicatorPointVisible: false,
},
},
]),
},
]);

For more configuration options see the Elevation Profile component in the Map components reference or the ElevationProfileAnalysis in the Core API reference.