{
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
//Note: Run within a QueuedTask
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);
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)