FRAMES | NO FRAMES
Classification Objects

Overview

This is supported from 10.1 onwards.

This document discusses the JSON classification definition objects. The classification definition optionally allows specifying symbology that would return a complete renderer object. It also includes an optional colorRamp object that is used to assign an unique color to each symbol.

The following classification definitions are discussed here:

Class Breaks

Use class breaks classification scheme to group values in to classes.

Note about optional parameters:

The type property for class breaks classification is classBreaksDef.

JSON Syntax

{
  "type": "classBreaksDef",
  "classificationField": "<field name>",
  "classificationMethod": "<esriClassifyNaturalBreaks | esriClassifyEqualInterval | esriClassifyQuantile | 
				esriClassifyStandardDeviation | esriClassifyGeometricalInterval>",
  "breakCount": <count>,
  "standardDeviationInterval": < 1 | 0.5 | 0.33 | 0.25 >, //use when classificationMethod is esriClassifyStandardDeviation.
  
  //optional. use to normalize class breaks
  "normalizationType": "<esriNormalizeByField | esriNormalizeByLog | esriNormalizeByPercentOfTotal>",
  "normalizationField": "<field name>", //use when normalizationType is esriNormalizeByField
  
  //optional. use to define symbol for classes
  "baseSymbol": <symbol>,
  "colorRamp": <colorRamp>
}

JSON Example

{
  "type": "classBreaksDef",
  "classificationField": "POP2010",
  "classificationMethod": "esriClassifyNaturalBreaks",
  "breakCount": 5,
  "normalizationType": "esriNormalizeByField",
  "normalizationField": "Area"
}

Unique Value

Use unique value classification scheme to group values based on a unique combination of one or more (up to 3) fields.

Note about optional parameters:

The type property for unique value classification is uniqueValueDef.

JSON Syntax

{
  "type": "uniqueValueDef",
  "uniqueValueFields": ["<field name 1 >","<field name 2>","<field name 3>"],
  "fieldDelimiter": "field_delimiter_character",
  
  //optional. use to define symbol for unqiue values
  "baseSymbol": <symbol>,
  "colorRamp": <colorRamp>
}

JSON Example

//uniqueValue classification definition with symbology
{
  "type": "uniqueValueDef",
  "uniqueValueFields": ["Type", "AdminClass"],
  "fieldDelimiter": ",",
  "baseSymbol":
  {
    "type": "esriSLS",
    "style": "esriSLSSolid",
    "width": 2
  }
  "colorRamp":
  {
    "type": "algorithmic",
    "fromColor": [115,76,0,255],
    "toColor": [255,25,86,255],
    "algorithm": "esriHSVAlgorithm"
  }
}