How to create Pie and Doughnut charts in WordPress via shortcode
Pie and Doughnut charts are ideal for showing part-to-whole values. Chartlet supports both via the same shortcode API.
1. Pie chart shortcode
Use this full shortcode with all major parameters:
[chartlet type="pie" labels="Jan,Feb,Mar" data="10,20,30" colors="#3366cc,#dc3912,#ff9900" title="Title" height="300" suffix="%" prefix="$"] 2. Doughnut chart shortcode
Switch only the type value:
[chartlet type="doughnut" labels="Jan,Feb,Mar" data="10,20,30" colors="#3366cc,#dc3912,#ff9900" title="Title" height="300" suffix="%" prefix="$"] 3. Parameter reference
- type:
pieordoughnut - labels: comma-separated labels
- data: comma-separated numeric values
- colors: comma-separated HEX colors
- title: chart title
- height: chart height in pixels
- prefix / suffix: format values with currency/units