Partial 3D pie graph #2
The code below is the source for this graph.
<?php
// Partial 3D pie graph #2
require_once 'SVGGraph/autoloader.php';
$settings = [
'back_stroke_width' => 0,
'auto_fit' => true,
'structure' => [
'key' => 0,
'value' => 1,
'explode' => 2,
],
'explode' => 'none',
'explode_amount' => 30,
'label_font_size' => 10,
'label_back_colour' => '#333',
'sort' => false,
'label_colour' => '#fff',
'aspect_ratio' => 'auto',
'start_angle' => 60,
'end_angle' => 120,
];
$type = 'Pie3DGraph';
$values = [
['Tea', 10],
['Coffee', 20, 1.0],
['Milk', 25, 0.5],
['Water', 50],
];
$colours = ['#e97','#630','#edd', ['#6bf','pattern' => 'polkadot2']];
$graph = new Goat1000\SVGGraph\SVGGraph(300, 200, $settings);
$graph->colours($colours);
$graph->values($values);
$graph->render($type);
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.