本文整理汇总了PHP中BarPlot::SetYMax方法的典型用法代码示例。如果您正苦于以下问题:PHP BarPlot::SetYMax方法的具体用法?PHP BarPlot::SetYMax怎么用?PHP BarPlot::SetYMax使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BarPlot
的用法示例。
在下文中一共展示了BarPlot::SetYMax方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: draw_artichow
//.........这里部分代码省略.........
// On boucle sur chaque lot de donnees
$legends = array();
$i = 0;
$nblot = count($this->data[0]) - 1;
while ($i < $nblot) {
$x = 0;
$values = array();
foreach ($this->data as $key => $valarray) {
$legends[$x] = $valarray[0];
$values[$x] = $valarray[$i + 1];
$x++;
}
// We fix unknown values to null
$newvalues = array();
foreach ($values as $val) {
$newvalues[] = is_numeric($val) ? $val : null;
}
if ($this->type[0] == 'bars') {
//print "Lot de donnees $i<br>";
//print_r($values);
//print '<br>';
$color = new Color($this->datacolor[$i][0], $this->datacolor[$i][1], $this->datacolor[$i][2], 20);
$colorbis = new Color(min($this->datacolor[$i][0] + 50, 255), min($this->datacolor[$i][1] + 50, 255), min($this->datacolor[$i][2] + 50, 255), 50);
$colorgrey = new Color(100, 100, 100);
$colorborder = new Color($this->datacolor[$i][0], $this->datacolor[$i][1], $this->datacolor[$i][2]);
if ($this->mode == 'side') {
$plot = new BarPlot($newvalues, $i + 1, $nblot);
}
if ($this->mode == 'depth') {
$plot = new BarPlot($newvalues, 1, 1, ($nblot - $i - 1) * 5);
}
$plot->barBorder->setColor($colorgrey);
//$plot->setBarColor($color);
$plot->setBarGradient(new LinearGradient($colorbis, $color, 90));
if ($this->mode == 'side') {
$plot->setBarPadding(0.1, 0.1);
}
if ($this->mode == 'depth') {
$plot->setBarPadding(0.1, 0.4);
}
if ($this->mode == 'side') {
$plot->setBarSpace(5);
}
if ($this->mode == 'depth') {
$plot->setBarSpace(2);
}
$plot->barShadow->setSize($this->SetShading);
$plot->barShadow->setPosition(SHADOW_RIGHT_TOP);
$plot->barShadow->setColor(new Color(160, 160, 160, 50));
$plot->barShadow->smooth(TRUE);
//$plot->setSize(1, 0.96);
//$plot->setCenter(0.5, 0.52);
// Le mode automatique est plus efficace
$plot->SetYMax($this->MaxValue);
$plot->SetYMin($this->MinValue);
}
if ($this->type[0] == 'lines') {
$color = new Color($this->datacolor[$i][0], $this->datacolor[$i][1], $this->datacolor[$i][2], 20);
$colorbis = new Color(min($this->datacolor[$i][0] + 20, 255), min($this->datacolor[$i][1] + 20, 255), min($this->datacolor[$i][2] + 20, 255), 60);
$colorter = new Color(min($this->datacolor[$i][0] + 50, 255), min($this->datacolor[$i][1] + 50, 255), min($this->datacolor[$i][2] + 50, 255), 90);
$plot = new LinePlot($newvalues);
//$plot->setSize(1, 0.96);
//$plot->setCenter(0.5, 0.52);
$plot->setColor($color);
$plot->setThickness(1);
// Set line background gradient
$plot->setFillGradient(new LinearGradient($colorter, $colorbis, 90));
$plot->xAxis->setLabelText($legends);
// Le mode automatique est plus efficace
$plot->SetYMax($this->MaxValue);
$plot->SetYMin($this->MinValue);
//$plot->setYAxis(0);
//$plot->hideLine(true);
}
//$plot->reduce(80); // Evite temps d'affichage trop long et nombre de ticks absisce satures
$group->legend->setTextFont(new $artichow_defaultfont(10));
// This is to force Artichow to use awFileFontDriver to
// solve a bug in Artichow with UTF8
if (count($this->Legend)) {
if ($this->type[0] == 'bars') {
$group->legend->add($plot, $this->Legend[$i], LEGEND_BACKGROUND);
}
if ($this->type[0] == 'lines') {
$group->legend->add($plot, $this->Legend[$i], LEGEND_LINE);
}
}
$group->add($plot);
$i++;
}
$group->axis->bottom->setLabelText($legends);
$group->axis->bottom->label->setFont(new $artichow_defaultfont(7));
//print $group->axis->bottom->getLabelNumber();
if ($this->labelInterval > 0) {
$group->axis->bottom->setLabelInterval($this->labelInterval);
}
$graph->add($group);
// Generate file
$graph->draw($file);
$this->_stringtoshow = '<!-- Build using ' . $this->_library . ' --><img src="' . $fileurl . '" title="' . dol_escape_htmltag($this->title ? $this->title : $this->YLabel) . '" alt="' . dol_escape_htmltag($this->title ? $this->title : $this->YLabel) . '">';
}
示例2: Color
//.........这里部分代码省略.........
$legends[$j] = $valarray[0];
$values[$j] = $valarray[$i+1];
$j++;
}
// Artichow ne gere pas les valeurs inconnues
// Donc si inconnu, on la fixe a null
$newvalues=array();
foreach($values as $val)
{
$newvalues[]=(is_numeric($val) ? $val : null);
}
if ($this->type == 'bars')
{
//print "Lot de donnees $i<br>";
//print_r($values);
//print '<br>';
$color=new Color($this->datacolor[$i][0],$this->datacolor[$i][1],$this->datacolor[$i][2],20);
$colorbis=new Color(min($this->datacolor[$i][0]+50,255),min($this->datacolor[$i][1]+50,255),min($this->datacolor[$i][2]+50,255),50);
$colorgrey=new Color(100,100,100);
$colorborder=new Color($this->datacolor[$i][0],$this->datacolor[$i][1],$this->datacolor[$i][2]);
if ($this->mode == 'side') $plot = new BarPlot($newvalues, $i+1, $nblot);
if ($this->mode == 'depth') $plot = new BarPlot($newvalues, 1, 1, ($nblot-$i-1)*5);
$plot->barBorder->setColor($colorgrey);
//$plot->setBarColor($color);
$plot->setBarGradient( new LinearGradient($colorbis, $color, 90) );
if ($this->mode == 'side') $plot->setBarPadding(0.1, 0.1);
if ($this->mode == 'depth') $plot->setBarPadding(0.1, 0.4);
if ($this->mode == 'side') $plot->setBarSpace(5);
if ($this->mode == 'depth') $plot->setBarSpace(2);
$plot->barShadow->setSize($this->SetShading);
$plot->barShadow->setPosition(SHADOW_RIGHT_TOP);
$plot->barShadow->setColor(new Color(160, 160, 160, 50));
$plot->barShadow->smooth(TRUE);
//$plot->setSize(1, 0.96);
//$plot->setCenter(0.5, 0.52);
// Le mode automatique est plus efficace
$plot->SetYMax($this->MaxValue);
$plot->SetYMin($this->MinValue);
}
if ($this->type == 'lines')
{
$color=new Color($this->datacolor[$i][0],$this->datacolor[$i][1],$this->datacolor[$i][2],20);
$colorbis=new Color(min($this->datacolor[$i][0]+20,255),min($this->datacolor[$i][1]+20,255),min($this->datacolor[$i][2]+20,255),60);
$colorter=new Color(min($this->datacolor[$i][0]+50,255),min($this->datacolor[$i][1]+50,255),min($this->datacolor[$i][2]+50,255),90);
$plot = new LinePlot($newvalues);
//$plot->setSize(1, 0.96);
//$plot->setCenter(0.5, 0.52);
$plot->setColor($color);
$plot->setThickness(1);
// Set line background gradient
$plot->setFillGradient( new LinearGradient($colorter, $colorbis, 90) );
$plot->xAxis->setLabelText($legends);
// Le mode automatique est plus efficace
$plot->SetYMax($this->MaxValue);
$plot->SetYMin($this->MinValue);
//$plot->setYAxis(0);
//$plot->hideLine(true);
}
//$plot->reduce(80); // Evite temps d'affichage trop long et nombre de ticks absisce satures
$group->legend->setTextFont(new Tuffy(10)); // This is to force Artichow to use awFileFontDriver to
// solve a bug in Artichow with UTF8
if (sizeof($this->Legend))
{
if ($this->type == 'bars') $group->legend->add($plot, $this->Legend[$i], LEGEND_BACKGROUND);
if ($this->type == 'lines') $group->legend->add($plot, $this->Legend[$i], LEGEND_LINE);
}
$group->add($plot);
$i++;
}
$group->axis->bottom->setLabelText($legends);
$group->axis->bottom->label->setFont(new Tuffy(7));
//print $group->axis->bottom->getLabelNumber();
if ($this->labelInterval > 0) $group->axis->bottom->setLabelInterval($this->labelInterval);
$graph->add($group);
// Generate file
$graph->draw($file);
}