ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / HeatMapRendererDefinition Class / WeightField Property
Example

In This Topic
    WeightField Property (HeatMapRendererDefinition)
    In This Topic
    Gets or sets the weight field used for the heat map.
    Syntax
    Public Property WeightField As String
    public string WeightField {get; set;}
    Example
    Create a Heatmap Renderer
    {
        string colorBrewerSchemesName = "ArcGIS Colors";
        //Get the style project item that contains the color ramps
        //Refer to the Initialize region for an example of how to get a style item
        //and the color ramp from it.
        //Note: Run within a QueuedTask
        //defining a heatmap renderer that uses values from Population field as the weights
        HeatMapRendererDefinition heatMapDef = new HeatMapRendererDefinition()
        {
            Radius = 20,
            WeightField = "Population",
            ColorRamp = colorRamp,
            RendereringQuality = 8,
            UpperLabel = "High Density",
            LowerLabel = "Low Density"
        };
        CIMHeatMapRenderer heatMapRndr = featureLayer.CreateRenderer(heatMapDef) as CIMHeatMapRenderer;
        featureLayer.SetRenderer(heatMapRndr);
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also