ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / KnowledgeGraphMappingExtensions Class / SetLinkChartLayoutAsync Method / SetLinkChartLayoutAsync(MapView,KnowledgeLinkChartLayoutAlgorithm,Boolean) Method
The link chart layout algorithm
Force an update to occur. Default value is false.
Example

In This Topic
    SetLinkChartLayoutAsync(MapView,KnowledgeLinkChartLayoutAlgorithm,Boolean) Method
    In This Topic
    Sets the layout algorithm for the link chart map view. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Overloads Shared Function SetLinkChartLayoutAsync( _
       ByVal mapView As MapView, _
       ByVal algorithm As KnowledgeLinkChartLayoutAlgorithm, _
       ByVal forceLayoutUpdate As Boolean _
    ) As Task

    Parameters

    mapView
    algorithm
    The link chart layout algorithm
    forceLayoutUpdate
    Force an update to occur. Default value is false.
    Exceptions
    ExceptionDescription
    Map cannot be null.
    Map is not a link chart.
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Example
    Get and set the link chart layout
    {
      //var map = MapView.Active.Map;
      // a MapView can encapsulate a link chart IF it's map
      // is of type MapType.LinkChart
      var isLinkChart = map.MapType == MapType.LinkChart;
      // or use the following
      // var isLinkChart = map.IsLinkChart;
    
      var mv = MapView.Active;
    
      await QueuedTask.Run(() =>
      {
        if (isLinkChart)
        {
          // get the layout algorithm
          var layoutAlgorithm = mv.GetLinkChartLayout();
    
          // toggle the value
          if (layoutAlgorithm == KnowledgeLinkChartLayoutAlgorithm.Geographic_Organic_Standard)
            layoutAlgorithm = KnowledgeLinkChartLayoutAlgorithm.Organic_Standard;
          else
            layoutAlgorithm = KnowledgeLinkChartLayoutAlgorithm.Geographic_Organic_Standard;
    
          // set it
          mv.SetLinkChartLayoutAsync(layoutAlgorithm);
    
          // OR set it and force a redraw / update
          // await mv.SetLinkChartLayoutAsync(layoutAlgorithm, true);
        }
      });
    }
    Requirements

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

    ArcGIS Pro version: 3.3 or higher.
    See Also