Skip to content

PieChart

The PieChart is a plot operator that computes a pie chart for a given vector dataset. Moreover, the operator considers all data in the given query rectangle.

There are multiple variants on how to compute the slices of the pie chart. In addition, it is possible to compute a donut chart instead of a standard pie chart.

The operator returns an error in the following cases.

  • The attribute for the given columnName does not exist.
  • The number of slices is too large: If the number of slices is greater than 32, the operator returns an error.

If the attribute has a Measurement of type Classification, the operator uses the class name instead of the raw value.

Name Type Description Examples
type string "count"
columnName string The names of the attribute to generate pies for. "name"
"class"
donut boolean Whether to render the chart as a donut. false
Name Type Description
vector VectorOperator An operator that produces vector data.
{
"type": "PieChart",
"params": {
"type": "count",
"columnName": "class",
"donut": false
},
"sources": {
"vector": {
"type": "OgrSource",
"params": {
"data": "land_use"
}
}
}
}