Dieses Besipiel zeigt eine gruppierte 3D-Balkengrafik mit Werteanzeige in den Labels.
<embed src="/charts/Beispiele/11-balken-vertikal-3d-titel-label-legende.php" type="image/svg+xml">
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,
'legend_title' => 'Legende',
'legend_back_colour' => 'none',
'legend_position' => 'outer top',
'show_labels' => true,
'show_data_labels' => true,
'data_label_type' => array('plain', 'box', 'bubble', 'line'),
'data_label_space' => 5,
'data_label_back_colour' => array('#ccc', null, null, '#ccc'),
'data_label_padding' => 5,
'data_label_round' => 4,
'data_label_tail_length' => 5,
'data_label_tail_width' => 5,
'data_label_font_size' => 12,
'data_label_fill' => array(
array('#ccc','#fff','#ccc','h'),
),
'data_label_outline_thickness' => 2,
'data_label_position' => 'above'
);
$settings['legend_entries'] = array(
'2012','2013','2014','Progn.2015'
);
$settings['graph_title'] = 'Titel der Grafik';
$settings['graph_title_font_size'] = '15';
$settings['label_x'] = 'Mitarbeiter';
$settings['label_y'] = 'Anzahl Urlaubstage';
$values = array(
array('Dough' => 30, 'Ray' => 20, 'Me' => 20, 'Sonnyboy' => 25, 'Far' => 25, 'Lard' => 12),
array('Dough' => 15, 'Ray' => 5, 'Me' => 24, 'Sonnyboy' => 5, 'Far' => 4, 'Lard' => 25),
array('Dough' => 5, 'Ray' => 15, 'Me' => 30, 'Sonnyboy' => 30, 'Far' => 20, 'Lard' => 5),
array('Dough' => 20, 'Ray' => 30, 'Me' => 20, 'Sonnyboy' => 15, 'Far' => 25, 'Lard' => 0)
);
$colours = array(array('red','yellow'), array('blue','blue'), array('yellow','white'), array('red','blue'));
$graph = new Goat1000\SVGGraph\SVGGraph(600, 400, $settings);
// $graph->colours = $colours;
$graph->colours($colours);
$graph->Values($values);
$graph->Render('GroupedBar3DGraph');
?>