4. Labelled axes

The code below is the source for this graph.

<?php
// 4. Labelled axes
require_once 'SVGGraph/autoloader.php';

$settings = [
  'back_stroke_width' => 0,
  'auto_fit' => true,
  'bar_space' => 6,
  'group_space' => 0,
  'marker_size' => 3,
  'label_space' => 5,
  'label_font' => 'Courier New',
  'label_font_size' => 12,
  'label_font_weight' => 'bold',
  'minimum_units_y' => 1,
  'structure' => [
    'key' => 0,
    'value' => [1,2],
  ],
  'axis_space' => 10,
  'label_v' => ['Sales', 'Ages'],
  'label_colour_v' => ['#930','#390'],
  'axis_text_colour_v' => ['#930','#390'],
  'axis_colour_v' => ['#930','#390'],
  'dataset_axis' => [0,1],
];

$width = 300;
$graph_type = 'MultiLineGraph';

$graph = new Goat1000\SVGGraph\SVGGraph($width, 200, $settings);

$graph->colours(['#c60','#6c0', '#06c', '#cc6']);
$values = [
  ['Bob', 15000, 42, 175, 65],
  ['Eve', 14000, 38, 178, 63],
  ['Sue', 16000, 45, 173, 61],
  ['Joe', 12500, 25, 179, 69],
  ['Pam', 19000, 28, 164, 60],
  ['Tim', 18000, 33, 181, 85],
];
$graph->values($values);
$graph->render($graph_type);

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.