Educational attainment by census tract visualized using a pie chart style.
What is a chart style?
A chart style visualizes two or more numeric attributes as a chart for each feature in a layer. You can use this style to visualize any variable with sub-categories such as the following:
Votes earned per candidate in an election
Languages spoken in the home
Race and ethnicity
How chart styles work
The pie chart style is configured with a PieChartRenderer. Currently, this is the only chart-based renderer available. A pie chart renderer requires a list of attributes (minimum of two) that match a color with a data value returned from a field or Arcade expression.
The resulting renderer will use the color of each attribute to create a slice proportional to the value returned from the field or expression. The othersCategory defines a color used to shade wedges smaller than a given threshold. This helps consolidate small wedges that are otherwise too small to read.
Examples
Pie charts
The following example demonstrates how to create a pie chart style where all charts have a consistent size for each feature. Generally, you should try to avoid creating charts that overlap. The size used in this example works well for the starting view scale, but is less successful at other scales. You should make larger charts as you zoom in to large scales and smaller charts as you zoom to small scales.
Varying pie chart sizes by the total or sum of all categories helps provide meaningful perspective to the map. Some patterns that emerge in pie chart styles may not be important if they represent very small populations. On the other hand, areas with large populations become more prominent when properly sized.
To vary pie charts by size, create a size variable using an Arcade expression that returns the sum of all categories considered in the pie chart's attributes.
Some people prefer to represent pie charts in a donut shape. This is easily configured by setting the holePercentage property of the PieChartRenderer. A value of zero indicates no hole (i.e. a pie), and any value greater than zero creates a hole by a fixed percentage of the pie. For example, a holePercentage of 0.5 removes 50% of the pie.
This can make pie charts look more modern and provide a space to place a number label if desired.