提问人:Chris Townsend 提问时间:8/2/2016 最后编辑:Payden K. PringleChris Townsend 更新时间:12/19/2022 访问量:537
JPGraph 4 & 3.5 - 当一条线出现在条形图的顶部时,它会在略微不同的位置呈现两次。为什么?
JPGraph 4 & 3.5 - When a line appears atop a barplot graph, it is rendered twice in slightly different positions. Why?
问:
JPGraph 版本 4 和 3.5 在创建顶部有一条线的图形时似乎存在问题。该线似乎在略微不同的位置渲染了两次。如果我将库恢复到版本 3,它就可以解决问题。我目前正在与他们的支持团队一起调查这个问题。Bar Plot
这是生成图形的代码
$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');
要访问演示,请转到此处。
版本 3(按预期工作):
版本 4(不同位置的双重渲染):
答: 暂无答案
评论