SVG

 view release on metacpan or  search on metacpan

examples/circle.pl  view on Meta::CPAN

#!/usr/bin/perl

use strict;
use warnings;


use SVG;

# create an SVG object with a size of 200x200 pixels
my $svg = SVG->new(
    width  => 200,
    height => 200,
);
$svg->title()->cdata('I am a title');

# use explicit element constructor to generate a group element
my $y = $svg->group(
    id    => 'group_y',
    style => {
        stroke => 'red',
        fill   =>'green',
    },
);

# add a circle to the group
$y->circle(
    cx => 100,
    cy => 100,
    r  => 50,
    id => 'circle_in_group_y',
);

$y->comment('This is a comment');

# now render the SVG object, implicitly use svg namespace
print $svg->xmlify;



( run in 1.058 second using v1.01-cache-2.11-cpan-d8267643d1d )