简短说明:
我刚刚安装了SVGGraph的 2.15.1 版本(撰写本文时的最新版本)。现在,当我设置它时,会弹出以下错误:
Error 8 @ line 1331 of APP_ROOT/inc/SVGGraph/SVGGraphGridGraph.php : Undefined index: rgb(0,0,0)`
作为参考,我的代码如下(位于基础 SVGGraph 文件夹中)。
<?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');
这1319 - 1350
是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;
}
}
}
}
那是。很好很简单。有没有人遇到过这个错误,他们知道如何解决它吗?
为了记录,如果我回显 $output,图表显示正常。我不知道这是否有帮助。