Image markers
The code below is the source for this graph.
<?php
// Image markers
require_once 'SVGGraph/autoloader.php';
$images = getenv('base') . '/images/';
$settings = [
'auto_fit' => true,
'show_axes' => false,
'show_tooltips' => false,
'back_stroke_width' => 0,
'axis_max_h' => 10,
'axis_max_v' => 16,
'grid_division_v' => 2,
'marker_type' => array(
"image:{$images}64x64/icon-11.png",
"image:{$images}64x64/icon-06.png",
"image:{$images}64x64/icon-08.png",
"image:{$images}64x64/icon-16.png",
),
'marker_size' => [15, 14, 15, 16],
'grid_back_colour' => '#f9f9f9',
'pad_left' => 5,
'pad_top' => 5,
'pad_right' => 5,
'pad_bottom' => 5,
'fill_under' => true,
'fill_opacity' => 0.8,
];
$values = [];
for($c = 4; $c > 0; --$c) {
$values[] = [1 => 6 - $c, 2, 3, 2, 3, 2, 3, 2, 6 - $c];
}
$graph = new Goat1000\SVGGraph\SVGGraph(650, 200, $settings);
$graph->colours([
['#e11','#fff'],
['#1b1','#fff'],
['#11e','#fff'],
['#e71','#fff'],
['#333','#fff'],
]);
$graph->values($values);
$graph->render('StackedLineGraph');
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.