protected function getValuesArea(Boundary $b) { $dy = $this->getD()->width; $dx = $this->getD()->height; $h = $this->axis['font_x']->getTextExtent($this->maxleg)->height; $dbottom = $b->bottom() - ($h < $dx * 4 ? $dx * 4 : $h); $dleft = $b->left() + $this->axis['font_y']->getTextExtent($this->max)->width + $dy * 2; $dtop = $b->top() + $this->depth; $dright = $b->right() + $this->depth; return new Boundary($dleft, $dtop, $dright, $dbottom); }
function drawTitle($image, Boundary $b) { $s = $this->title['font']->getTextExtent($this->title['text']); //var_dump(imagettfbbox($this->title['font']->size,$this->title['font']->angle,$this->title['font']->family,$this->title['text'])); //throw new exception ($s->height); if ($s->height > $b->height() || $s->width > $b->width()) { throw new ChartException("Недостаточно места для вывода заголовка."); } $b->bottom($b->top() + $s->height); $title = new Label($b, $this->title['text'], $this->title['font'], $this->title['color'], Label::ALIGN_CENTER_TOP); $title->draw($image); }