Use an AlgorithmicColorRamp to color a ClassBreaksRenderer


PurposeThis sample demonstrates a tool for producing a user-specified AlgorithmicColorRamp, which is used to color the symbols on a ClassBreaksRenderer on a feature layer.

How to use

See How to use ArcGIS samples for help on compiling, setting up the debugger, and running the sample. If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

  1. Open the Visual Studio solution file and build the project.
  2. Start ArcMap and create a map.
  3. Open the Customize dialog box. On the Toolbars tab, select the Context Menus option. The Context Menus toolbar appears.
  4. Using the Context Menus toolbar, click Context Menus and click Feature Layer Context Menu. The Feature Layer context menu appears.
  5. On the Commands tab on the Customize dialog box, select the new AlgorithmicColorRamp command from the Developer Samples category. Drag this command onto the Feature Layer context menu that was displayed in the previous step. Close the Customize dialog box.
  6. Add a feature layer (containing polygons, lines, or points) to the map document.
  7. Render your layer with a ClassBreaksRenderer. Right-click the layer and click Properties, then Symbology. Choose the Quantities, GraduatedColors option and add values from any suitable Value field.
  8. Change the colors on the renderer by right-clicking the feature layer in the table of contents (TOC). The dialog box that appears allows you to create an AlgorithmicColorRamp based on a FromColor, a ToColor, and an Algorithm.
  9. Click OK to recolor your feature layer renderer according to your selections.

AlgorithmicColorRamp.cs Class module containing tool implementation.
frmAlgorithmicColorRamp.cs Windows form file containing the tool's dialog box.
Download the C# files
AlgorithmicColorRamp.vb Class module containing tool implementation.
frmAlgorithmicColorRamp.vb Windows form file containing the tool's dialog box.
Download the VB.NET files

Download the files for all languages




Development licensing Deployment licensing
ArcGIS for Desktop Basic ArcGIS for Desktop Basic
ArcGIS for Desktop Standard ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced ArcGIS for Desktop Advanced