AnsweredAssumed Answered

Set break values for 'Manual' GraduatedColorsRendererDefinition

Question asked by adbirch on Feb 22, 2017
Latest reply on Mar 10, 2017 by UHarano-esristaff

I want to create a GraduatedColorsRendererDefinition using the 'Manual' classification method (in order to set breaks at unequal intervals (for example at 0.4, 0.7, 0.9, 1). Where can I set the required break values? I can't see the appropriate member on GraduatedColorsRendererDefinition. Other classification methods (defined interval, for example) work fine.

 

// Apply renderer and add output to map
Uri uri = new Uri(OutputPath);
string colorBrewerSchemesName = "ArcGIS Colors";
StyleProjectItem style = Project.Current.GetItems<StyleProjectItem>().First(s => s.Name == colorBrewerSchemesName);
string colorRampName = "Red to Green";
IList<ColorRampStyleItem> colorRampList = await style.SearchColorRampsAsync(colorRampName);
ColorRampStyleItem colorRamp = colorRampList[0];
CIMStroke outline = SymbolFactory.ConstructStroke(ColorFactory.GreyRGB, 0, SimpleLineStyle.Solid);
await QueuedTask.Run(() =>
{
    GraduatedColorsRendererDefinition gcDef = new GraduatedColorsRendererDefinition()
    {
        ClassificationField = "VALUE",

        // Defined Interval works fine
        //ClassificationMethod = ClassificationMethod.DefinedInterval,
        //IntervalSize = 0.2,

        // How to set breaks for Manual classification method?
        ClassificationMethod = ClassificationMethod.Manual,
        // Set break values?

        ColorRamp = colorRamp.ColorRamp,
        SymbolTemplate = SymbolFactory.ConstructPolygonSymbol(
        ColorFactory.GreenRGB, SimpleFillStyle.Solid, outline).MakeSymbolReference(),
    };
    FeatureLayer outLyr = LayerFactory.CreateFeatureLayer(uri, MapView.Active.Map, rendererDefinition: gcDef);
});

Outcomes