Beispiel 25 - Balken Diagram horizontal

Quellcode

<?php
require '../../svggraph/autoloader.php';
$settings = array(
  'back_colour' => '#eee',
  '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',
  'minimum_grid_spacing' => 20
);

$settings['graph_title']= "Wachstum  der Bevölkerung in den einzelnen Ländern der heutigen EU\n"."2019 zu 1960 in %";
$settings['auto_fit'] = true;

$values = array(
 array(
'Dough' => -30, // bei PopulationPyramid neg.Werte nicht erlaubt
'Ray' => 50,
'Me' => 40,
'So' => 25,
'Far' => 45,
'Lard' => 35
),
// Diese 2. Datenreihe ist nur für HorizontalStackedBarGraph, HorizontalGroupedBarGraph und PopulationPyramid relevant
array(
'Dough' => 20,
'Ray' => 30,
'Me' => 20,
'So' => 15,
'Far' => 25,
'Lard' => 35,
'Tea' => 45
)
);

$colours = array(
  array('red','yellow'), array('blue','white')
);

$graph = new Goat1000\SVGGraph\SVGGraph(400, 300, $settings);
$graph->colours($colours);
$graph->values($values);
$graph->render('HorizontalBarGraph');
// $graph->render('HorizontalStackedBarGraph');
// $graph->render('HorizontalGroupedBarGraph');
// $graph->render('PopulationPyramid');
?>