* @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2 * @author Icinga Development Team */ // {{{ICINGA_LICENSE_HEADER}}} namespace Icinga\Chart\Primitive; use Icinga\Chart\Render\RenderContext; class Circle extends Styleable implements Drawable { private $x; private $y; private $radius; public function __construct($x, $y, $radius) { $this->x = $x; $this->y = $y; $this->radius = $radius; } public function toSvg(RenderContext $ctx) { $coords = $ctx->toAbsolute($this->x, $this->y); $circle = $ctx->getDocument()->createElement('circle'); $circle->setAttribute('cx', $coords[0]); $circle->setAttribute('cy', $coords[1]); $circle->setAttribute('r', 5); $circle->setAttribute('style', $this->getStyle()); return $circle; } }