styles; } /** * Add child item with styles. * * @param string|array|CSvgTag Child item. * * @return CSvgTag */ public function addItem($value) { if ($value instanceof CSvgTag) { $this->styles = $value->makeStyles() + $this->styles; } return parent::addItem($value); } /** * Set axis container size. * * @param int $width Axis container width. * @param int $height Axis container height. * * @return CSvgTag */ public function setSize($width, $height) { $this->width = $width; $this->height = $height; return $this; } /** * Set axis container position. * * @param int $x Horizontal position of container element. * @param int $y Vertical position of container element. * * @return CSvgTag */ public function setPosition($x, $y) { $this->x = (int) $x; $this->y = (int) $y; return $this; } public function setFillColor($color) { $this->setAttribute('fill', $color); return $this; } public function setStrokeColor($color) { $this->setAttribute('stroke', $color); return $this; } public function setStrokeWidth($width) { $this->setAttribute('stroke-width', $width); return $this; } public function setFillOpacity($opacity) { $this->setAttribute('fill-opacity', $opacity); return $this; } public function setStrokeOpacity($opacity) { $this->setAttribute('stroke-opacity', $opacity); return $this; } }