Transform-Canvas
view release on metacpan or search on metacpan
examples/02-graph.pl view on Meta::CPAN
my $cy_line = $t->mapY($y_line);
print STDERR "x_line, y_line = $x_line,$y_line -- cx_line, cy_line = $cx_line,$cy_line\n";
#draw the 1/10 x gridline in the canvas space
$g->line( x1=> $cx_line, y1=>$t->cy0, x2=> $cx_line, y2=>$t->cy1, );
#draw the 1/10 y gridline in the canvas space
$g->line( y1=> $cy_line, x1=>$t->cx0, y2=> $cy_line, x2=>$t->cx1,);
#write the 1/10 x text
$l->text( x=>$cx_line, y=>$t->cy1 + 10,
'text-anchor'=>'middle',)
->cdata($x_line);
#write the 1/10 y text
$l->text( y=>$cy_line,x=>$t->cx0 - 10,
'text-anchor'=>'middle',)
->cdata("$y_line");
}
$a->rect(x=>$t->cx0,y=>$t->cy0,
width=>$t->cx1-$t->cx0,
height=>$t->cy1-$t->cy0,
fill=>'none',stroke=>'red');
print $a->xmlify();
( run in 0.660 second using v1.01-cache-2.11-cpan-454fe037f31 )