Best-fit combined line
The code below is the source for this graph.
<?php
// Best-fit combined line
require_once 'SVGGraph/autoloader.php';
$settings = array(
'auto_fit' => true,
'show_tooltips' => false,
'back_stroke_width' => 0,
'axis_max_h' => 20,
'grid_division_v' => 10,
'marker_size' => 4,
'marker_type' => 'cross',
'grid_back_colour' => '#f9f9f9',
'pad_left' => 5,
'pad_top' => 5,
'pad_right' => 5,
'pad_bottom' => 5,
'structured_data' => true,
'best_fit' => 'curve',
'best_fit_colour' => array('#e99', '#6b6', '#66e', '#e9e'),
'best_fit_combined' => 'curve',
'grid_back_stripe' => true,
'grid_back_stripe_colour' => '#fff',
);
$values = array();
srand(1);
for($i = 2; $i < 18; ++$i) {
for($c = 1; $c < 5; ++$c) {
$val = array($i + 0.05 * (rand(10, 100) - 50));
$val[$c] = $c + 0.95 * rand($c, 100);
$values[] = $val;
}
}
$graph = new Goat1000\SVGGraph\SVGGraph(600, 200, $settings);
$graph->colours($settings['best_fit_colour']);
$graph->values($values);
$graph->render('MultiScatterGraph');
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.
