Beispiel 1
Quellcode 1
<?php
require '../../svggraph/autoloader.php';
$settings['auto_fit'] = true;
$settings['title'] = "Leeres Chart mit zwei Untercharts";
$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,
'Tea' => 45)
);
$graph = new Goat1000\SVGGraph\SVGGraph(600, 200, $settings);
// $graph->values($values);
$inner_settings=$settings;
$inner_settings ['title'] = "1. Untergrafik";
$subgraph = $graph->subgraph('LineGraph', 10, 10, 280, 130, null, $inner_settings);
$inner_values = array('Dough' => 30, 'Ray' => 50, 'Me' => 40, 'So' => 25, 'Far' => 45,
'Lard' => 135);
$subgraph->values($inner_values);
$subsubgraph = $subgraph->subgraph('PieGraph', 'g7', 'gt', 'u3', 'u3x', $settings); //, $pie_settings);
$subsubgraph->values($values);
$subsubgraph->colourRangeHexHSL(0, '#f00', '#00f', true);
$graph->render('EmptyGraph');
?>
Beispiel 2
Quellcode 2
<?php
require '../../svggraph/autoloader.php';
$settings['auto_fit'] = true;
$settings['title'] = "Leeres Chart mit zwei Untercharts";
$subgraph1_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,
'Tea' => 45)
);
$graph = new Goat1000\SVGGraph\SVGGraph(600, 200, $settings);
// $subgraph1->values($subgraph1_values);
// $graph->values($values);
// $subgraph1_settings=$settings;
$subgraph1_settings ['title'] = "1. Untergrafik";
$subgraph1 = $graph->subgraph('LineGraph', 10, 10, 280, 130, null, $subgraph1_settings);
$subgraph1_values = array('Dough' => 30, 'Ray' => 50, 'Me' => 40, 'So' => 25, 'Far' => 45,
'Lard' => 135);
$subgraph1->values($subgraph1_values);
$subgraph2 = $subgraph1->subgraph('PieGraph', 'g7', 'gt', 'u4', 'u3x', $settings); //, $pie_settings);
$subgraph2->values($subgraph1_values);
$subgraph2->colourRangeHexHSL(0, '#f00', '#0ff', true);
$graph->render('EmptyGraph');
?>
Beispiel 3
Quellcode 3
<?php
require '../../svggraph/autoloader.php';
$haupt_settings['auto_fit'] = true;
$haupt_settings['graph_title'] = "Grafik vom Typ EmptyGraph";
$haupt_settings['graph_title_font_size'] = '15';
$graph = new Goat1000\SVGGraph\SVGGraph(640, 480, $haupt_settings);
$subgraph1_values = array('Dough' => 30, 'Ray' => 50, 'Me' => 40, 'So' => 25, 'Far' => 45,
'Lard' => 135);
$subgraph1_settings = $haupt_settings;
$subgraph1_settings['graph_title'] = "Grafik vom Typ LineGraph in EmptyGraph";
$subgraph1_settings['graph_title_font_size'] = '10';
$subgraph1 = $graph->subgraph('LineGraph', 10, 40, 200, 200, null, $subgraph1_settings);
$subgraph1->values($subgraph1_values);
$subgraph2_values = array('Otto' => 130, 'Paul' => 60, 'Ich' => 40);
$subgraph2_settings = $haupt_settings;
$subgraph2_settings['graph_title'] = "Grafik vom Typ PieGraph in EmptyGraph";
$subgraph2_settings['graph_title_font_size'] = '10';
// $subgraph2 = $subgraph1->subgraph('PieGraph', 300, 40, 200, 200, null, $subgraph2_settings);
$subgraph2 = $graph->subgraph('PieGraph', 300, 40, 200, 200, null, $subgraph2_settings);
$subgraph2->values($subgraph2_values);
$subgraph2->colourRangeHexHSL(0, '#aaa', '#0ff', true);
$graph->Render('EmptyGraph');
?>