本文整理汇总了PHP中ezcGraphRenderer::drawBox方法的典型用法代码示例。如果您正苦于以下问题:PHP ezcGraphRenderer::drawBox方法的具体用法?PHP ezcGraphRenderer::drawBox怎么用?PHP ezcGraphRenderer::drawBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ezcGraphRenderer
的用法示例。
在下文中一共展示了ezcGraphRenderer::drawBox方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* Render the text
*
* @param ezcGraphRenderer $renderer Renderer
* @param ezcGraphBoundings $boundings Boundings for the axis
* @return ezcGraphBoundings Remaining boundings
*/
public function render(ezcGraphRenderer $renderer, ezcGraphBoundings $boundings)
{
$height = (int) min(round($this->properties['maxHeight'] * ($boundings->y1 - $boundings->y0)), $this->properties['font']->maxFontSize + $this->padding * 2 + $this->margin * 2);
switch ($this->properties['position']) {
case ezcGraph::TOP:
$textBoundings = new ezcGraphBoundings($boundings->x0, $boundings->y0, $boundings->x1, $boundings->y0 + $height);
$boundings->y0 += $height + $this->properties['margin'];
break;
case ezcGraph::BOTTOM:
$textBoundings = new ezcGraphBoundings($boundings->x0, $boundings->y1 - $height, $boundings->x1, $boundings->y1);
$boundings->y1 -= $height + $this->properties['margin'];
break;
}
$textBoundings = $renderer->drawBox($textBoundings, $this->properties['background'], $this->properties['border'], $this->properties['borderWidth'], $this->properties['margin'], $this->properties['padding']);
$renderer->drawText($textBoundings, $this->properties['title'], ezcGraph::CENTER | ezcGraph::MIDDLE);
return $boundings;
}
示例2: render
/**
* Render the background
*
* @param ezcGraphRenderer $renderer Renderer
* @param ezcGraphBoundings $boundings Boundings
* @return ezcGraphBoundings Remaining boundings
*/
public function render(ezcGraphRenderer $renderer, ezcGraphBoundings $boundings)
{
$boundings = $renderer->drawBox($boundings, $this->background, $this->border, $this->borderWidth, $this->margin, $this->padding);
if ($this->image === false) {
return $boundings;
}
$renderer->drawBackgroundImage($boundings, $this->image, $this->position, $this->repeat);
return $boundings;
}
示例3: render
/**
* Render a legend
*
* @param ezcGraphRenderer $renderer Renderer
* @param ezcGraphBoundings $boundings Boundings for the axis
* @return ezcGraphBoundings Remaining boundings
*/
public function render(ezcGraphRenderer $renderer, ezcGraphBoundings $boundings)
{
$boundings = $this->calculateBoundings($boundings);
if ($this->position === ezcGraph::LEFT || $this->position === ezcGraph::RIGHT) {
$type = ezcGraph::VERTICAL;
} else {
$type = ezcGraph::HORIZONTAL;
}
// Render standard elements
$this->properties['boundings'] = $renderer->drawBox($this->properties['boundings'], $this->properties['background'], $this->properties['border'], $this->properties['borderWidth'], $this->properties['margin'], $this->properties['padding'], $this->properties['title'], $this->getTitleSize($this->properties['boundings'], $type));
// Render legend
$renderer->drawLegend($this->boundings, $this, $type);
return $boundings;
}