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

时间:2016-08-02 11:12:44

标签: php jpgraph

JPGraph版本4和版本似乎存在问题。 3.5创建Bar Plot图表时,顶部有一行。该线似乎在稍微不同的位置呈现两次。如果我将库恢复到版本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');

要访问演示,请转到here

第3版(按预期工作):

Version 3

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

Version 4

0 个答案:

没有答案