PAD Charts
All charts/Pie & donut

Eleven kinds of fruit

Past eight slices the smallest are folded into a grey Other.

1 The data pie/fruit.php php
<?php

  // Crates sold at the market on a Saturday.

  $fruit = [];

  foreach ( [ 'Apples' => 120, 'Bananas' => 95, 'Pears' => 64, 'Oranges' => 88, 'Grapes' => 41,
              'Kiwis' => 23, 'Plums' => 18, 'Cherries' => 35, 'Mangos' => 12, 'Lemons' => 9,
              'Figs' => 6 ] as $kind => $crates )
    $fruit [] = [ 'kind' => $kind, 'crates' => $crates ];

?>
2 The chart tag pie/fruit.pad pad
{chart 'pie', data='fruit', label='kind', value='crates', title='Crates sold, by fruit', width=560, height=320}
3 The result inline SVG · no JavaScript
Crates sold, by fruit Apples: 120 (23.5%); Bananas: 95 (18.6%); Pears: 64 (12.5%); Oranges: 88 (17.2%); Grapes: 41 (8%); Kiwis: 23 (4.5%); Cherries: 35 (6.8%); Other: 45 (8.8%) Apples: 120 (23.5%) Bananas: 95 (18.6%) Pears: 64 (12.5%) Oranges: 88 (17.2%) Grapes: 41 (8%) Kiwis: 23 (4.5%) Cherries: 35 (6.8%) Other: 45 (8.8%) Apples 120 (23.5%) Bananas 95 (18.6%) Pears 64 (12.5%) Oranges 88 (17.2%) Grapes 41 (8%) Kiwis 23 (4.5%) Cherries 35 (6.8%) Other 45 (8.8%)