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.

Parameters

ParameterTypeDescriptionExample Value
typePie Chart TypeThe type of aggregation that is used to create the slices of the pie chart."count"
columnNameStringThe names of the attribute to generate pies for."name"

Pie Chart Type

The type parameter can be one of the following values:

  • count: Creates one slice for each distinct value in the given column columnName. Then, it counts the number of occurrences.

Inputs

The operator consumes exactly one vector operator.

ParameterType
vectorSingleVectorSource

Errors

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.

Notes

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

Example JSON

{
  "type": "PieChart",
  "params": {
    "type": "count",
    "columnName": "name",
    "donut": false
  },
  "sources": {
    "vector": {
      "type": "OgrSource",
      "params": {
        "data": "ndvi"
      }
    }
  }
}