Dear Ken,
To put it in a more simpler way I need to get the output of the code below in form of a pie. Probably this will be a subroutine with the shown inputs that will be taken dynamically.can you help me in getting the values for $x1, $x2, $y1, $y2 in the code dynamically.
use strict; use Tk; my $mw = new MainWindow(-title => 'Test'); my $canvas = $mw->Canvas(-width => 512, -height => 512)->pack; ## input ######################### my $start_x = 0; my $stary_y = 0; my $radius = 10; my @data = (4,5,2,6,8); ######################### my $slices = $data; my $slice_angle = 360/$slices; foreach my $this_value (@data) { my $x1 = ?; ## need to get dynamically my $y1 = ?; ## need to get dynamically my $x2 = ?; ## need to get dynamically my $y2 = ?; ## need to get dynamically $canvas->createArc( $x1, $y2, $x2, $y2, -start => 0, -extent => $slice +_angle, -style => 'pieslice', ); } MainLoop;
In reply to Re^2: Creating Pie chart based graph network
by KuntalBhusan
in thread Creating Pie chart based graph network
by KuntalBhusan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |