Example #1
0
        $curX = $nextX;
        $curY = $nextY;
    }
    list($eX, $eY) = ArcUtils::getPolarPoint($r2, end($radians));
    if ($r1 !== $r2) {
        $path->lineTo($eX, $eY);
    }
    return $path;
}
$graphic = new Graphic();
$graphic->setViewportCorners(-300, -300, 300, 300);
$graphic->getDefaultTextFontStyle()->setName(FontStyle::FONT_HELVETICA)->setHAlign(FontStyle::HORIZONTAL_ALIGN_MIDDLE);
// draw group labels
$graphic->getDefaultShapeStrokeStyle()->setColor('gray');
$graphic->addPath(getGroupPath(275, 280, 1, 118));
$graphic->addPathText('Meine Gruppe', getGroupPath(280, 280, 1, 118));
$graphic->addPath(getGroupPath(275, 280, 121, 118));
$graphic->addPathText('Meine andere Gruppe', getGroupPath(280, 280, 121, 118));
$graphic->addPath(getGroupPath(275, 280, 241, 118));
$graphic->addPathText('Meine dritte Gruppe', getGroupPath(280, 280, 241, 118));
// draw inner arcs
$graphic->getDefaultTextFontStyle()->setVAlign(FontStyle::VERTICAL_ALIGN_CENTRAL);
$graphic->getDefaultTextFillStyle()->setColor('white');
$graphic->getDefaultShapeFillStyle()->setColor(HtmlColor::rgb(236, 88, 85));
$graphic->getDefaultShapeStrokeStyle()->setColor('white');
for ($i = -4; $i < 25; $i++) {
    $arc = $graphic->addRingArc(0, 0, 6 * $i + 50, 240, 15 * $i, 15);
    $arc->setFillOpacity(($i + 8) / 32.0);
    $anchor = $arc->getAnchor(RingArc::ALPHA_CENTRAL, RingArc::RADIUS_MIDDLE);
    $graphic->addText($i, $anchor->x, $anchor->y);
    //->setRotation($anchor->getRotation());
Example #2
0
$path->curveTo($radius * sin(7.0 / 5.0 * pi()) / 2, $radius * cos(7.0 / 5.0 * pi()) / 2, $radius * sin(9.0 / 5.0 * pi()) / 2, $radius * cos(9.0 / 5.0 * pi()) / 2, $radius * sin(0.0 / 5.0 * pi()), $radius * cos(0.0 / 5.0 * pi()));
$path->close();
$graphic->addPath($path)->setFillColor('black', 0.3);
$radius = 80;
$path = new Path($radius * sin(1.0 / 5.0 * pi()), $radius * cos(1.0 / 5.0 * pi()));
$path->lineTo($radius * sin(5.0 / 5.0 * pi()), $radius * cos(5.0 / 5.0 * pi()));
$path->lineTo($radius * sin(9.0 / 5.0 * pi()), $radius * cos(9.0 / 5.0 * pi()));
$path->lineTo($radius * sin(3.0 / 5.0 * pi()), $radius * cos(3.0 / 5.0 * pi()));
$path->lineTo($radius * sin(7.0 / 5.0 * pi()), $radius * cos(7.0 / 5.0 * pi()));
$path->lineTo($radius * sin(1.0 / 5.0 * pi()), $radius * cos(1.0 / 5.0 * pi()));
$path->close();
$graphic->addPath($path)->setFillColor('black')->setStrokeColor('blue', 0.6)->setOpacity(0.6);
$radius = 20;
$path = new Path($radius * sin(0.0 / 3.0 * pi()), $radius * cos(0.0 / 3.0 * pi()));
$path->lineTo($radius * sin(2.0 / 3.0 * pi()), $radius * cos(2.0 / 3.0 * pi()));
$path->lineTo($radius * sin(4.0 / 3.0 * pi()), $radius * cos(4.0 / 3.0 * pi()));
$path->close();
$path->moveTo($radius * sin(1.0 / 3.0 * pi()), $radius * cos(1.0 / 3.0 * pi()));
$path->lineTo($radius * sin(5.0 / 3.0 * pi()), $radius * cos(5.0 / 3.0 * pi()));
$path->lineTo($radius * sin(3.0 / 3.0 * pi()), $radius * cos(3.0 / 3.0 * pi()));
$path->close();
$graphic->addPath($path)->setFillColor('gray')->setStrokeColor('black', 0.6)->setOpacity(0.6);
$graphic->addCircle(0, 0, 80)->setStrokeColor('green');
// just supported in svg-writer, yet
$text = $graphic->addPathText('Round and Round and Round and Round ...', $p1);
$text->setFont(12);
$text->align(FontStyle::HORIZONTAL_ALIGN_MIDDLE, FontStyle::VERTICAL_ALIGN_BOTTOM);
$text->setStrokeColor('red');
$text->setStrokeWidth(0.2);
$text->setOpacity(0.4);
return $graphic;