JPGraph 4&3.5 - 当一条线出现在条形图上方时,它会在稍微不同的位置呈现两次.为什么?

Chr*_*end 12 php jpgraph

在创建Bar Plot顶部有一条线的图形时,JPGraph版本4和3.5似乎存在问题.该线似乎在稍微不同的位置呈现两次.如果我将库恢复到版本3,它将解决问题.我目前正在与他们的支持团队调查此问题.

这是生成图表的代码

$graph = new Graph($w, $h, 'auto');

$graph->SetScale("textint", 0,10);
$graph->SetMargin(0,0,0,0); // left, right, top, bottom.
$graph->SetMarginColor('white');
$graph->SetBox(false);
$graph->SetFrame(false);
$graph->SetY2OrderBack(false);
$graph->img->SetAntiAliasing(false);

$graph->yaxis->SetTickPositions([0,2,4,6,8,10]);
$graph->yaxis->HideLabels();
$graph->xaxis->HideLabels();
$graph->xaxis->SetTickLabels( ['2012', '2013', '2014', '2015'] );
$graph->xaxis->SetLabelAlign('center','center');

$graph->ygrid->SetFill(true,'#f3f3f4','#ffffff');
$graph->ygrid->Show();

$colour_one = $this->colors['blue_dark'];
$colour_two = $this->colors['blue'];
$line = $this->colors['line'];

$barplot = new BarPlot($bars);
$graph->Add($barplot);

$barplot->SetFillColor(array($colour_one, $colour_one, $colour_one, $colour_two));
$graph->SetColor($this->colors['text']);

$graph->yaxis->HideZeroLabel();
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false,false);

$group_standard = new LinePlot($lines[0]);
$group_standard->SetBarCenter();

$graph->Add($group_standard);
$group_standard->SetStyle('dashed');
$group_standard->SetColor($line);

$twenty_fifteen_target = new LinePlot($lines[1]);
$twenty_fifteen_target->SetBarCenter();
$twenty_fifteen_target->SetStyle('solid');
$twenty_fifteen_target->SetColor($line);

$graph->Add($twenty_fifteen_target);

$graph->Stroke(storage_path().'/audit-generator/images/graphs/' . $name . '.png');
Run Code Online (Sandbox Code Playgroud)

要访问演示,请访问此处.

版本3(按预期工作):

版本3

版本4(在不同位置的双重渲染):

版本4