Beispiel 17 - Mehrfachscala

<?php
// siehe http://www.goat1000.com/svggraph-legends.php
$debug=false;
require '../../svggraph/autoloader.php';
$settings['structured_data'] = true;
$settings['force_assoc'] = true;
$settings['pad_left'] = 20;
$settings['axis_overlap'] = 2;
$settings['thousands'] = '';
// $settings['decimal'] = ',';
$settings['structure'] = array(
  'key' => 0,
  'value' => array(1,2),
  'legend_text' => array('l1', 'l2')
);
// $settings['legend_autohide'] = TRUE;
// $settings['legend_title'] = 'Legende';
// $settings['legend_columns'] = 3;
// $settings['legend_position'] = 'bottom';
$settings['graph_title']= 'Gesamtzahl der Tatverdächtigen lt. PKS 1993-2016 (in Tsd.)';
$settings['auto_fit'] = true;
$settings['axis_font_size'] = 6;
$settings['dataset_axis'] = array(0, 1);
$settings['axis_min_v'] = array(2000.000,5900.000);
$settings['axis_max_v'] = array(2400.000,7000.000);
$settings['grid_division_v'] = array(50.000, 100.000);
$values = array(
  array('1993', 2051.775, 6750.613),
  array('1994', 2037.729, 6537.748),
  array('1995', 2118.104, 6668.717),
  array('1996', 2213.293, 6647.598),
  array('1997', 2273.560, 6586.165),
  array('1998', 2319.895, 6456.996),
  array('1999', 2263.140, 6302.316),
  array('2000', 2286.372, 6264.723),
  array('2001', 2280.611, 6363.865),
  array('2002', 2326.149, 6507.394),
  array('2003', 2355.161, 6572.135),
  array('2004', 2384.268, 6633.156),
  array('2005', 2313.136, 6391.715),
  array('2006', 2283.127, 6304.223),
  array('2007', 2294.883, 6284.661),
  array('2008', 2255.693, 6114.128),
  array('2009', 2187.217, 6054.330),
  array('2010', 2152.803, 5933.278),
  array('2011', 2112.843, 5990.679),
  array('2012', 2094.118, 5997.040),
  array('2013', 2094.160, 5961.662),
  array('2014', 2149.504, 6082.064),
  array('2015', 2369.036, 6330.649),
  array('2016', 2360.806, 6372.526),
);

$graph = new Goat1000\SVGGraph\SVGGraph(400, 300, $settings);
 $colours = array('blue','red');
$graph->Colours($colours);

// ab hier Debugging oder Datenanzeige
if ($debug==true){
    echo "<pre>";
    print_r($settings);
    echo "</pre>";
    echo "<pre>";
    print_r($graph);
    echo "</pre>";
}
$graph->Values($values);
if ($debug==true){
    echo "<pre>";
    print_r($graph);
    echo "</pre>";
}
else {
    $graph->Render('MultiLineGraph');
    // $graph->Render('StackedBarGraph');
    // $graph->Render('GroupedBarGraph');
    // $graph->Render('StackedGroupedBarGraph'); // meldet stack_group not set for StackedGroupedBarGraph
    // $graph->Render('BarAndLineGraph');
    // $graph->Render('StackedBarAndLineGraph');
    // $graph->Render('Histogram'); // aber Daten sinnlos

    // $graph->Render('Bar3DGraph');
    // $graph->Render('CylinderGraph');
    // $graph->Render('StackedBar3DGraph');
    // $graph->Render('StackedCylinderGraph');
    // $graph->Render('GroupedBar3DGraph');
    // $graph->Render('GroupedCylinderGraph');
    // $graph->Render('StackedGroupedBar3DGraph'); //stack_group not set for StackedGroupedBarGraph
    // $graph->Render('StackedGroupedCylinderGraph'); //stack_group not set for StackedGroupedBarGraph

    // $graph->Render('HorizontalBarGraph');    
    // $graph->Render('HorizontalStackedBarGraph');
    // $graph->Render('HorizontalGroupedBarGraph');
    // $graph->Render('PopulationPyramid');


    // $graph->Render('LineGraph');
    // $graph->Render('MultiLineGraph');
    // $graph->Render('StackedLineGraph');
    // $graph->Render('BarAndLineGraph'); // bereits oben getestet

    // $graph->Render('ScatterGraph');
    // $graph->Render('MultiScatterGraph');

    // $graph->Render('RadarGraph');
    // $graph->Render('MultiRadarGraph');

    // $graph->Render('FloatingBarGraph'); //Required field(s) [end] not set in data structure
    // $graph->Render('HorizontalFloatingBarGraph'); //Required field(s) [end] not set in data structure
    // $graph->Render('BubbleGraph');   // Required field(s) [area] not set in data structure
    // $graph->Render('BoxAndWhiskerGraph'); // Required field(s) [top, bottom, wtop, wbottom] not set in data structure
}
?>