* @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2 * @author Icinga Development Team */ // {{{ICINGA_LICENSE_HEADER}}} namespace Icinga\Chart\Primitive; class Styleable { public $strokeWidth = 0; public $strokeColor = '#000'; public $fill = 'none'; public $additionalStyle = ''; public $opacity = '1'; /** * @param mixed $stroke */ public function setStrokeWidth($width) { $this->strokeWidth = $width; return $this; } public function setStrokeColor($color) { $this->strokeColor = $color ? $color : 'none'; return $this; } public function setAdditionalStyle($styles) { $this->additionalStyle = $styles; return $this; } public function setFill($color = null) { $this->fill = $color ? $color : 'none'; return $this; } public function getStyle() { $base = sprintf("fill: %s; stroke: %s;stroke-width: %s;", $this->fill, $this->strokeColor, $this->strokeWidth); $base .= ';' . $this->additionalStyle . ';'; return $base; } }