Pie Chart Renderer

This renderer allows you to create pie charts to compare numeric values between categories within the same group.

Referenced by: renderer

Properties

Property Details
attributes[] An array of AttributeColorInfo objects defining the color of each slice.
authoringInfo An object containing metadata about the authoring process for creating a renderer object. This allows the authoring clients to save specific overridable settings so that next time it is accessed via the UI, their selections are remembered. Non-authoring clients can ignore it.
See authoringInfo properties table.
backgroundFillSymbol The symbols used to represent the polygon fill behind the pie charts.
defaultColor Defines the color used to represent features where all values of attributes are either null or zero. This is typically used to represent areas with 'no data' or 'no values' in the legend.
defaultLabel The text used to describe the defaultColor in the legend. Typically, this label will be something similar to 'No data' or 'No values'.
holePercentage Defines the size of the hole to cut from the center of the chart as a percentage of the size of the chart. For example, a value of 0 will render a full pie chart. A value of 0.5 will remove 50% of the center of the pie. This property is used to create a donut chart.
legendOptions Options for describing the renderer in the legend.
See legendOptions properties table.
othersCategory Defines how to aggregate small pie slices to a generic "others" category.
outline Sets the outline of the pie chart. The outline width is applied to the outer outline of the pie (and inner outline in the case of donut charts). The outline color is applied to the outer and inner outlines, and the boundaries of the slices.
size The diameter of the pie chart in points.
type Specifies the type of renderer used.
Valid value of this property pieChart
visualVariables[] An array of sizeInfo objects used to vary the size of the pie charts.

authoringInfo properties

Property Details
visualVariables[] An array of visualVariable objects containing additional information needed when authoring the renderer.

legendOptions properties

Property Details
title The title of the legend.

Pie Chart Renderer Example

Pie Chart Renderer of population by race/ethnicity in the United States.

{
  "type": "pieChart",
  "attributes": [
    {
      "color": [
        242,
        60,
        63,
        255
      ],
      "field": "B03002_003E",
      "label": "White (non-Hispanic)"
    },
    {
      "color": [
        232,
        202,
        13,
        255
      ],
      "field": "B03002_012E",
      "label": "Hispanic"
    },
    {
      "color": [
        0,
        182,
        241,
        255
      ],
      "field": "B03002_004E",
      "label": "Black or African American"
    },
    {
      "color": [
        50,
        239,
        148,
        255
      ],
      "field": "B03002_006E",
      "label": "Asian"
    },
    {
      "color": [
        255,
        127,
        233,
        255
      ],
      "field": "B03002_005E",
      "label": "American Indian/Alaskan Native"
    },
    {
      "color": [
        226,
        196,
        165,
        255
      ],
      "field": "B03002_007E",
      "label": "Pacific Islander/Hawaiian Native"
    },
    {
      "color": [
        255,
        106,
        0,
        255
      ],
      "field": "B03002_008E",
      "label": "Other race"
    },
    {
      "color": [
        150,
        247,
        239,
        255
      ],
      "field": "B03002_009E",
      "label": "Two or more races"
    }
  ],
  "outline": {
    "color": [
      0,
      0,
      128,
      255
    ],
    "width": 0,
    "type": "esriSLS",
    "style": "esriSLSSolid"
  },
  "size": 24,
  "holePercentage": 0
}

Pie Chart Renderer as donuts with varied sizes Example

Pie chart renderer showing population by languages spoken in the home. Each pie is sized based on the total of all categories considered in the pie.

{
  "type": "pieChart",
  "visualVariables": [
    {
      "type": "sizeInfo",
      "valueExpression": "$feature.B16007_calc_numEngOnlyE + $feature.B16007_calc_numSpanE + $feature.B16007_calc_numIEE + $feature.B16007_calc_numAPIE + $feature.B16007_calc_numOtherE",
      "maxDataValue": 37000000,
      "maxSize": 52,
      "minDataValue": 500000,
      "minSize": 16
    }
  ],
  "attributes": [
    {
      "color": [
        242,
        60,
        63,
        255
      ],
      "field": "B16007_calc_numEngOnlyE",
      "label": "English"
    },
    {
      "color": [
        0,
        182,
        241,
        255
      ],
      "field": "B16007_calc_numSpanE",
      "label": "Spanish"
    },
    {
      "color": [
        255,
        127,
        233,
        255
      ],
      "field": "B16007_calc_numIEE",
      "label": "Other Indo-European languages"
    },
    {
      "color": [
        255,
        106,
        0,
        255
      ],
      "field": "B16007_calc_numAPIE",
      "label": "Asian/Pacific Islander languages"
    },
    {
      "color": [
        232,
        202,
        13,
        255
      ],
      "field": "B16007_calc_numOtherE",
      "label": "Other languages"
    }
  ],
  "othersCategory": {
    "color": [
      242,
      60,
      63,
      255
    ],
    "threshold": 0.4,
    "label": "All other values"
  },
  "holePercentage": 0.5,
  "outline": {
    "type": "esriSLS",
    "color": [
      0,
      0,
      0,
      255
    ],
    "width": 1,
    "style": "esriSLSSolid"
  },
  "size": 35,
  "defaultColor": [
    0,
    0,
    0,
    0
  ],
  "defaultLabel": "Data not available"
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.