Short explanation:
I have just installed version 2.15.1 of SVGGraph (the latest at the time of writing). Now when I am setting it up I have the following error pop up:
Error 8 @ line 1331 of APP_ROOT/inc/SVGGraph/SVGGraphGridGraph.php : Undefined index: rgb(0,0,0)`
For reference my code is below (located in the base SVGGraph folder).
<?php
require_once 'SVGGraph.php';
$graph = new SVGGraph(400, 300, array('namespace' => true));
$graph->Values(1, 4, 8, 9, 16, 25, 27);
$output = $graph->fetch('LineGraph');
And this is lines 1319 - 1350
in SVGGraphGridGraph
.
if($this->show_divisions) {
// use an array to join paths with same colour
$div_paths = array();
if($this->show_axis_h) {
$points = $this->GetGridPointsX(0);
$dx_path = $this->XAxisDivisions($points,
$this->GetFirst($this->division_style_h, $this->division_style),
$this->GetFirst($this->division_size_h, $this->division_size),
$yoff);
if(!empty($dx_path)) {
$dx_colour = $this->GetFirst($this->division_colour_h,
$this->division_colour, $this->axis_colour);
@$div_paths[$dx_colour] .= $dx_path; // <== Line 1331 <==
}
}
if($this->show_axis_v) {
for($i = 0; $i < $y_count; ++$i) {
if(!is_null($this->y_axes[$i])) {
$points = $this->GetGridPointsY($i);
$dy_path = $this->YAxisDivisions($points,
$i > 0 ? $this->g_width : $xoff, false, $i);
if(!empty($dy_path)) {
$dy_colour = $this->GetFirst(
$this->ArrayOption($this->division_colour_v, $i),
$this->division_colour,
$this->ArrayOption($this->axis_colour_v, $i),
$this->axis_colour);
@$div_paths[$dy_colour] .= $dy_path;
}
}
}
}
Thats is. Nice and simple. Has anyone come across this error and do they have any idea how to fix it?
And for the record if I echo out $output, the graph displays fine. I dont know if that helps or not.