Lines and crosses
The code below is the source for this graph.
<?php
// Lines and crosses
require_once 'SVGGraph/autoloader.php';
$settings = [
'auto_fit' => true,
'pad_bottom' => 1,
'back_stroke_width' => 0,
'grid_colour' => '#ccc',
'axis_font_h' => 'Arial',
'axis_font_size_h' => 13,
'show_tooltips' => false,
'grid_division_v' => 5,
'figure' => [
['round',
[ 'circle', 'cx' => 4, 'cy' => 4, 'r' => 3, 'stroke' => 'blue' ],
[ 'circle', 'cx' => 6, 'cy' => 6, 'r' => 3, 'stroke' => 'blue' ],
[ 'circle', 'cx' => 5, 'cy' => 5, 'r' => 5, 'stroke' => 'red' ],
],
],
];
$width = 670;
$height = 100;
$values = [
'line' => 10,
'line2' => 8,
'line3' => 10,
'line4' => 8,
'cross' => 10,
'cross2' => 8,
'cross3' => 10,
];
$colours = [
['purple', 'pattern' => 'line'],
['purple', 'pattern' => 'line2'],
['purple', 'pattern' => 'line3'],
['purple', 'pattern' => 'line4'],
['orange', 'pattern' => 'cross'],
['orange', 'pattern' => 'cross2'],
['orange', 'pattern' => 'cross3'],
];
$graph = new Goat1000\SVGGraph\SVGGraph($width, $height, $settings);
$graph->colours($colours);
$graph->values($values);
$graph->render('BarGraph');
Please note: the source code above comes from a script used to generate one of the example graphs on the site. This is simply a wrapper page to apply highlighting and make the source code easier to read, so there is no content here to describe what the source code is doing.