ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / ClassBreaksRendererDefinition Class / BreakCount Property
Example

In This Topic
    BreakCount Property (ClassBreaksRendererDefinition)
    In This Topic
    Gets or sets number of desired class breaks. The default value is 5.
    Syntax
    Public Property BreakCount As Integer
    public int BreakCount {get; set;}
    Remarks
    Optional, it does not apply when StandardDeviation or DefinedInterval is used as the classification method.
    Example
    Create a feature layer with class breaks renderer
    {
        string colorBrewerSchemesName = "ColorBrewer Schemes (RGB)";
        StyleProjectItem colorBrewerStyle = Project.Current.GetItems<StyleProjectItem>().First(s => s.Name == colorBrewerSchemesName);
        string colorRampName = "Greens (Continuous)";
        //Note: Needs QueuedTask to run
        IList<ColorRampStyleItem> colorRampListFromTheStyle = colorBrewerStyle.SearchColorRamps(colorRampName);
    
        ColorRampStyleItem colorRampFound = colorRampList[0];
        GraduatedColorsRendererDefinition gcDef = new GraduatedColorsRendererDefinition()
        {
            ClassificationField = "CROP_ACR07",
            ClassificationMethod = ArcGIS.Core.CIM.ClassificationMethod.NaturalBreaks,
            BreakCount = 6,
            ColorRamp = colorRampFound.ColorRamp,
            SymbolTemplate = SymbolFactory.Instance.ConstructPolygonSymbol(
                                  ColorFactory.Instance.GreenRGB, SimpleFillStyle.Solid, null).MakeSymbolReference(),
            ExclusionClause = "CROP_ACR07 = -99",
            ExclusionSymbol = SymbolFactory.Instance.ConstructPolygonSymbol(
                                  ColorFactory.Instance.RedRGB, SimpleFillStyle.Solid, null).MakeSymbolReference(),
            ExclusionLabel = "No yield",
        };
        var featureLayerCreationParams = new FeatureLayerCreationParams((new Uri(@"c:\Data\CountyData.gdb\Counties")))
        {
            Name = "Crop",
            RendererDefinition = gcDef
        };
        //Note: Needs QueuedTask to run
        LayerFactory.Instance.CreateLayer<FeatureLayer>(featureLayerCreationParams, MapView.Active.Map);
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also