Colour filters example
The code below is the source for this graph.
<?php
// Colour filters example
require_once 'SVGGraph/autoloader.php';
$settings = [
'auto_fit' => true,
'axis_font' => 'Arial',
'axis_font_size' => 12,
'grid_division_v' => 20,
'bar_round' => 10,
'bar_space' => 20,
'stroke_width' => 5,
'stroke_colour' => 'fillColour/brightness(-20%)',
'grid_colour' => ['#aaa','#f00'],
];
$values = [
155, 98, 122, 85, 94, 112, 120, 88
];
$colours = [
'red',
'red/hue(30)',
'red/hue(60)',
'red/hue(90)',
'red/hue(120)',
'red/hue(150)',
'red/hue(180)',
'red/hue(210)',
];
$graph = new Goat1000\SVGGraph\SVGGraph(670, 300, $settings);
$graph->values($values);
$graph->colours($colours);
$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.