Background image and shadow
The code below is the source for this graph.
<?php
// Background image and shadow
require_once 'SVGGraph/autoloader.php';
$settings = [
'auto_fit' => true,
'back_colour' => '#eee',
'back_stroke_width' => 0,
'stroke_colour' => '#000',
'axis_colour' => '#333',
'axis_overlap' => 2,
'axis_font' => 'Arial',
'axis_font_size' => 10,
'link_base' => '/',
'link_target' => '_top',
'minimum_grid_spacing' => 20,
'show_subdivisions' => true,
'show_grid_subdivisions' => true,
'pad_right' => 20,
'pad_left' => 20,
'back_image' => getenv('base') . '/images/svgbg.png',
'show_shadow' => true,
'shadow_blur' => 4,
'shadow_opacity' => 0.8,
'shadow_offset_x' => 6,
'bar_width' => 30,
'axis_font_size' => 14,
'back_image_mode' => 'tile',
'back_image_width' => 320,
'back_image_height' => 200,
'show_subdivisions' => false,
'grid_colour' => '#ccc',
'grid_subdivision_colour' => '#ddd',
];
$width = 600;
$height = 200;
$values = [
'Dough' => 30, 'Ray' => 50, 'Me' => 40, 'So' => 25, 'Far' => 45, 'Lard' => 35
];
$colours = [ [ 'red','yellow'], ['blue','white'] ];
$graph = new Goat1000\SVGGraph\SVGGraph($width, $height, $settings);
$graph->colours($colours);
$links = [
'Dough' => 'jpegsaver.php',
'Ray' => 'crcdropper.php',
'Me' => 'svggraph.php'
];
$graph->values($values);
$graph->links($links);
$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.