Dieses Besipiel zeigt eine gruppierte 3D-Balkengrafik.
<embed src="/charts/Beispiele/09-balken-vertikal-3d-gruppe.php" type="image/svg+xml">
Die ursprünglich im Quellcode enthaltenen Links für einzelne Balken wurden deaktiviert.
Quellcode
<?php
// siehe http://www.goat1000.com/svggraph-bar3d.php
require '../../svggraph/autoloader.php';
$settings = array(
'auto_fit' => true,
'back_colour' => 'none',
'stroke_colour' => '#000',
'back_stroke_width' => 0,
'back_stroke_colour' => '#eee',
'axis_colour' => '#333',
'axis_overlap' => 2,
'axis_font' => 'Georgia',
'axis_font_size' => 10,
'grid_colour' => '#666',
'label_colour' => '#000',
'pad_right' => 20,
'pad_left' => 20,
'link_base' => '/',
'link_target' => '_top',
'project_angle' => 45,
'minimum_grid_spacing' => 20
);
$values = array(
array('Dough' => 30, 'Ray' => 50, 'Me' => 40, 'So' => 25, 'Far' => 45, 'Lard' => 35),
array('Dough' => 20, 'Ray' => 30, 'Me' => 20, 'So' => 15, 'Far' => 25, 'Lard' => 35)
);
// $colours = array(array('red','yellow'), array('blue','white'));
// $links = array('Dough' => 'jpegsaver.php', 'Ray' => 'crcdropper.php',
// 'Me' => 'svggraph.php');
$graph = new Goat1000\SVGGraph\SVGGraph(400, 400, $settings);
// $graph->colours = $colours;
$graph->Values($values);
// $graph->Links($links);
$graph->Render('GroupedBar3DGraph');
?>