Pie Chart
The Pie Chart represents data relatively, as proportional slices of the pie.
Interactions
Hovering on a segment shows a tooltip with the core data. Clicking on a segment selects it for comparison - all of it’s data is shown where the key would normally be and the user can hover on another segment for comparison.
If your data is quite crowded, the Pie Chart will group the smallest segments into an ‘other’ segment which, on click, will bloom to reveal all of the data.
Usage
The first column represents the names of the Segments; the second column represents the size of each segment.
If you put data in columns 3+ it will show up in the key area when a user clicks on a segment.
Example
Product | Units sold | Channel |
---|---|---|
Ice cream | 1500 | Shop |
Umbrellas | 6500 | Shop |
Horse shoes | 4200 | Online |
Pencils | 2500 | Online |
Mugs | 3200 | Shop |
Wizard hats | 100 | Shop |
Light bulbs | 300 | Online |
Fire extinguishers | 200 | Online |
Wheelbarrows | 400 | Online |
Deck chairs | 200 | Shop |
Options
The following data attributes are available for a Pie Chart.
- data-fm-value-prefix
- Adds a prefix to the values. For example, you may wish to add the ‘£’ symbol before each number
- data-fm-value-suffix
- Adds a suffix to each of your values. For example, you may wish to add the ‘$’ symbol after each number
- data-fm-max-key-entries
- Specifies a maximum number of entries to display in the key
- data-fm-height
- Enforces an explicit height. Expects a value with CCS syntax, e.g. "250px" (see sizing guide)
- data-fm-width
- Enforces an explicit width. Expects a value with CCS syntax, e.g. "800px" (see sizing guide)
- data-fm-enable-spillover
- If "true", the pie chart will draw some transient elements outside of its configured height and width (see layout guide)
Customizing colours
You can customize the colours for the sections of your pie chart. This is achieved by applying a data-fm-color
attribute to the <tr>
element that relates to the section you want to colour. The attribute will accept hex codes and RGB colour values, but not colour names: