Skip to content

Pie chart card

The Pie chart card groups entity values and displays each group’s share of the result.

When to use it

Use it for a small number of categories where proportions matter. Use Bar chart when readers need easier comparison across many categories.

Live example

The Card Lab groups deterministic device records in the production pie chart.

Requirements

Requirement Value
Dashboard types Standard
Minimum size 3 columns by 5 rows
Data Entity rows from the selected dashboard context
Backend capabilities Entity search for the selected type
Permissions Read access to fields used by the expressions

Configuration

The paths below are relative to cardConfig.data.

title

Property Value
Type string
Required No
Default No title
Values Plain text with dashboard interpolation

Sets the chart heading.

entityType

Property Value
Type string
Required Yes
Default No default
Values device, interface, client, or group

Selects the source collection.

groupJmesPath

Property Value
Type JMESPath expression
Required For useful output
Default Runtime fallback: -
Values An expression returning category labels

The card counts equal values in the expression result.

colorMapping

Property Value
Type Object mapping labels to colors
Required No
Default Carbon chart colors
Values Presets red, green, yellow, orange, blue, or a valid hex color

Assigns colors case-insensitively by rendered group label. Saved JSON uses an object even though the guided editor displays rows.

localCardFilter

Property Value
Type JMESPath expression
Required No
Default No filter
Values An expression returning an array

Filters only this card before grouping.

Examples

Device reachability

{
  "cardId": "pie-chart",
  "data": {
    "title": "Device reachability",
    "entityType": "device",
    "groupJmesPath": "[].connectionState",
    "colorMapping": {
      "REACHABLE": "green",
      "UNREACHABLE": "red"
    }
  }
}

The slices show the proportion of devices in each connection state.

Behavior

The card refreshes with entity and filter changes and shows a skeleton while loading or after an error. Selecting a slice applies a chart filter to the selected entity context; selecting it again clears that filter.

Limitations and safety

Large numbers of distinct labels produce a crowded legend. Chart selection affects other cards that share the entity context.

See Bar chart and Aggregation pie chart.