ParetoChart

The code below is the source for this graph.

<?php
// ParetoChart
require_once 'SVGGraph/autoloader.php';

$settings = [
  'auto_fit' => true,
  'back_colour' => '#eee',
  'back_stroke_width' => 0,
  'back_stroke_colour' => '#eee',
  'stroke_colour' => '#000',
  'axis_colour' => '#333',
  'axis_overlap' => 2,
  'grid_colour' => '#666',
  'label_colour' => '#000',
  'axis_font' => 'Arial',
  'axis_font_size' => 10,
  'pad_right' => 20,
  'pad_left' => 20,
  'link_base' => '/',
  'link_target' => '_top',
  'minimum_grid_spacing' => 20,
  'show_subdivisions' => true,
  'show_grid_subdivisions' => true,
  'grid_subdivision_colour' => '#ccc',
  'line_dataset' => [1, 2],
  'fill_under' => false,
  'marker_type' => ['circle','square'],
  'marker_size' => 3,
  'marker_colour' => ['blue','red'],
];

$width = 300;
$height = 200;
$type = 'ParetoChart';
$values = [
  ['Dough' => 30, 'Ray' => 50, 'Me' => 40, 'So' => 25, 'Far' => 45, 'Lard' => 35],
  ['Dough' => 20, 'Ray' => 30, 'Me' => 20, 'So' => 15, 'Far' => 25, 'Lard' => 35, 'Tea' => 45],
  ['Dough' => 10, 'Ray' => 20, 'Me' => 20, 'So' => 25, 'Far' => 15, 'Lard' => 20, 'Tea' => 20],
  ['Dough' => 30, 'Ray' => 10, 'Me' => 20, 'So' => 35, 'Far' => 25, 'Lard' => 25, 'Tea' => 45],
];

$colours = [ ['red', 'yellow'], ['blue', 'white'],
  ['green', 'pattern' => 'polkadot', 'size' => 6],
  ['orange','pattern' => 'check', 'size' => 6]
];

$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($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.