/**
  * Construct a circle
  * 
  * @param integer $cx the center x
  * @param integer $cy the center y
  * @param integer $radius the radius of circle
  * @param string $id the id of element
  * @param SVGStyle $style style of element
  * 
  * @return SVGCircle 
  */
 public static function getInstance($cx, $cy, $radiusX, $radiusY, $id = null, $style = null)
 {
     $circle = new SVGEllipse('<ellipse></ellipse>');
     $circle->setCx($cx);
     $circle->setCy($cy);
     $circle->setRadius($radiusX, $radiusY);
     $circle->setId($id);
     $circle->setStyle($style);
     return $circle;
 }
예제 #2
0
#$rect->style->setStroke('#e1a100'); //still not work
$rect->setWidth($svg->getWidth());
#make the rect of the size of pages
$rect->skewX(5);
#make a skew x transformation
$rect->rotate(1);
#make a rotation
$rect->setRound(30);
$svg->addShape($rect);
#add the rect to svg
$style = new SVGStyle();
$style->setFill('green');
$style->setStroke('black', 5);
$circle = SVGCircle::getInstance(200, 100, 20, null, $style);
$svg->addShape($circle);
$ellipse = SVGEllipse::getInstance(200, 200, 100, 40);
$ellipse->rotate(-30, 200, 200);
$style2 = new SVGStyle();
$style2->setFill('none');
$style2->setStroke('blue', 3);
$ellipse->setStyle($style2);
$svg->addShape($ellipse);
$style = new SVGStyle();
#create a style object
#set fill and stroke
$style->setFill('#f2f2f2');
$style->setStroke('#e1a100');
$style->setStrokeWidth(2);
#create a text
$text = SVGText::getInstance(22, 50, 'myText', 'This is a text', $style);
$svg->addShape($text);