ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MapView Class / ShowElevationProfileGraph Method / ShowElevationProfileGraph(ElevationProfileResult) Method
The elevationProfile result.
Example

In This Topic
    ShowElevationProfileGraph(ElevationProfileResult) Method
    In This Topic
    Shows the elevation profile of the specified ElevationProfileResult. An ElevationProfileResult is obtained from a Map.GetElevationProfileFromSurface function call. The Z values of the geometry of the elevationProfile is displayed as-is; no additional Z calculations are performed.
    Syntax
    Public Overloads Sub ShowElevationProfileGraph( _
       ByVal elevationProfile As ElevationProfileResult _
    ) 
    public void ShowElevationProfileGraph( 
       ElevationProfileResult elevationProfile
    )

    Parameters

    elevationProfile
    The elevationProfile result.
    Exceptions
    ExceptionDescription
    elevationProfile is null.
    An elevation profile cannot be displayed on the current map.
    The specified elevationProfile does not have a valid result that can be displayed in a profile.
    Remarks
    Use the ElevationProfileGraphAdded delegate to determine when the elevation profile graph is added to the mapView. Once this has occurred, MapView.GetElevationProfileGraph will return a non-null ElevationProfileGraph.
    Example
    Show Elevation profile graph using an ElevationProfileResult
    {
        MapPoint startPt = MapPointBuilderEx.CreateMapPoint(-130, 20, SpatialReferences.WGS84);
        MapPoint endPt = MapPointBuilderEx.CreateMapPoint(-100, 50, SpatialReferences.WGS84);
        var elevProfileResult = await MapView.Active.Map.GetElevationProfileFromSurfaceAsync(startPt, endPt, 10);
        if (elevProfileResult.Status != SurfaceZsResultStatus.Ok)
            return;
    
        if (!MapView.Active.CanShowElevationProfileGraph())
            return;
    
        // show the elevation profile using the result
        MapView.Active.ShowElevationProfileGraph(elevProfileResult);
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.5 or higher.
    See Also