All donut graph types
The code below is the source for this graph.
<?php
// All donut graph types
require_once 'SVGGraph/autoloader.php';
$settings = [
'back_stroke_width' => 0,
'back_shadow' => 3,
'back_colour' => 'white',
'auto_fit' => true,
'stroke_width' => 0.5,
'stroke_colour' => 'fill/saturation(90%)/brightness(50%)',
'show_tooltips' => false,
'show_shadow' => true,
'shadow_opacity' => 0.3,
'structure' => [
'key' => 0, 'value' => [ 1, 2, 3,],
],
'sort' => false,
'inner_text_font_size' => 14,
'inner_radius' => 0.6,
'label_position' => 0.8,
'data_label_font_weight' => 'bold',
'depth' => 15,
'donut_slice_gap' => 2,
'depth_shade_gradient' => ['#fff:0.7', '#999:0.3', '#111:0.8', 'h'],
'array_graph_type' => [
'DonutGraph', 'ExplodedDonutGraph', 'SemiDonutGraph', 'ExplodedSemiDonutGraph',
'Donut3DGraph', 'ExplodedDonut3DGraph', 'SemiDonut3DGraph', 'ExplodedSemiDonut3DGraph',
],
'array_graph_dataset' => [ 0, 1, 0, 1, 0, 1, 0, 1 ],
];
$values = [
["A", 318.6, 585.2, 1200,],
["B", 134.8, 263.4, ],
["C", 312.4, 623.9, ],
["D", 181, 449.3, 900,],
["E", 176.7, 370.6, ],
["F", 623.4, 1519, ],
["G", 409, 1215, 1600, ],
["H", 206.4, 644.6, ],
["I", 259.8, 714.3, ],
["J", 333.2, 773.3, ],
["K", 459, 1405, ],
["L", 180.2, 519.3, 1200],
];
$graph = new Goat1000\SVGGraph\SVGGraph(670, 300, $settings);
$graph->values($values);
$graph->colourRangeHexHSL(0, 'red/saturation(180%)/brightness(120%)',
'yellow/brightness(80%)', false);
$graph->render('ArrayGraph');
Please note: the source code above comes from a script used to generate one of the example graphs on the site. This is simply a wrapper page to apply highlighting and make the source code easier to read, so there is no content here to describe what the source code is doing.