ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / UnclassedColorsRendererDefinition Class / NullValueSymbol Property
Example

In This Topic
    NullValueSymbol Property (UnclassedColorsRendererDefinition)
    In This Topic
    Gets or sets the out of range symbol used in the renderer.
    Syntax
    public CIMSymbolReference NullValueSymbol {get; set;}
    Public Property NullValueSymbol As CIMSymbolReference
    Example
    Create an unclassed 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
      await QueuedTask.Run(() =>
      {
      CIMPointSymbol pointSym = SymbolFactory.Instance.ConstructPointSymbol(ColorFactory.Instance.GreenRGB, 16.0, SimpleMarkerStyle.Diamond);
      CIMSymbolReference symbolPointTemplate = pointSym.MakeSymbolReference();
    
      //defining an unclassed renderer with custom upper and lower stops
      //all features with value >= 5,000,000 will be drawn with the upper color from the color ramp
      //all features with value <= 50,000 will be drawn with the lower color from the color ramp
      UnclassedColorsRendererDefinition unclassRndrDef = new UnclassedColorsRendererDefinition
                            ("Population", symbolPointTemplate, colorRamp, "Highest", "Lowest", 5000000, 50000)
      {
    
        //drawing features with null values with a different symbol
        ShowNullValues = true,
        NullValueLabel = "Unknown"
      };
      // Create a point symbol for null values
      CIMPointSymbol nullSym = SymbolFactory.Instance.ConstructPointSymbol(ColorFactory.Instance.RedRGB, 16.0, SimpleMarkerStyle.Circle);
      unclassRndrDef.NullValueSymbol = nullSym.MakeSymbolReference();
      //Create the unclassed renderer using the definition
      CIMClassBreaksRenderer cbRndr = featureLayer.CreateRenderer(unclassRndrDef) as CIMClassBreaksRenderer;
      //Set the renderer to the feature layer
      featureLayer.SetRenderer(cbRndr);
      });
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also