本文整理汇总了PHP中GroupBarPlot::setWidth方法的典型用法代码示例。如果您正苦于以下问题:PHP GroupBarPlot::setWidth方法的具体用法?PHP GroupBarPlot::setWidth怎么用?PHP GroupBarPlot::setWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GroupBarPlot
的用法示例。
在下文中一共展示了GroupBarPlot::setWidth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createBarGraph
private function createBarGraph()
{
// Create the graph.
$graph = new Graph($this->width, $this->height, "auto");
$graph->SetScale("textlin");
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$graph->SetFrame(false);
// ... and add it to the graph
//$graph->xaxis->title->Set(Prado::localize('title'));
//$graph->xaxis->SetTickLabels($this->xdata);
//$graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD);
// First make the labels look right
$graph->yaxis->SetLabelFormat('%d');
$graph->yaxis->SetLabelSide(SIDE_LEFT);
$graph->yaxis->SetLabelMargin(5);
$graph->yaxis->scale->SetGrace(0.1);
$graph->yaxis->HideZeroLabel();
$graph->ygrid->SetFill(true, '#f2f2f2@0.5', '#cacaca@0.5');
if ($this->shadow) {
$graph->SetShadow();
}
// Create the bar plot
$tmpArray = array();
if ($this->numberdimensions > 1) {
for ($ii = 1; $ii <= $this->numberpivots; $ii++) {
for ($jj = 0; $jj < $this->numberchildren; $jj++) {
${'tmpArray' . $ii . $jj} = array();
/*${'bplot'.$jj} = new BarPlot($this->ydata[$ii][$jj]);
${'bplot'.$jj}->SetFillColor($this->colorarray[$jj]);
${'bplot'.$jj}->value->Show();
${'bplot'.$jj}->value->SetFormat('%d');
${'bplot'.$jj}->value->SetColor("black");
${'bplot'.$jj}->SetValuePos('top');
array_push(${'tmpArray'.$ii},${'bplot'.$jj});*/
array_push(${'tmpArray' . $ii . $jj}, $this->ydata[$ii][$jj]);
${'bplot' . $ii . $jj} = new BarPlot(${'tmpArray' . $ii . $jj});
${'bplot' . $ii . $jj}->SetFillColor($this->colorarray[$jj]);
${'bplot' . $ii . $jj}->value->Show();
${'bplot' . $ii . $jj}->value->SetFormat('%d');
${'bplot' . $ii . $jj}->value->SetColor("black");
${'bplot' . $ii . $jj}->SetValuePos('top');
//array_push($tmpArray,${'tmpArray'.$ii});
array_push($tmpArray, ${'bplot' . $ii . $jj});
}
}
$gbplot = new GroupBarPlot($tmpArray);
$gbplot->setWidth(0.9);
$gbplot->SetLegend(Prado::localize($this->legend));
$graph->Add($gbplot);
} else {
$tmpArray = array();
for ($ii = 0; $ii < $this->numberpivots; $ii++) {
array_push($tmpArray, $this->ydata[1][$ii]);
}
$bplot = new BarPlot($tmpArray);
$bplot->value->Show();
$bplot->value->SetFormat('%d');
$bplot->value->SetColor("black");
$bplot->SetValuePos('center');
$bplot->SetWidth(0.8);
$bplot->SetLegend(Prado::localize($this->legend));
$graph->Add($bplot);
}
return $graph;
}