my $count; my $points; foreach my $row(@{$self->{row}{label}}) { my $data=$self->{columns}{$column}->{data}{$row}; my $data_o=$data; # data original my $data_w=$data; # data for display; $count++; $data=$data/($self->GetRowSum($row)/100) if $self->{ENV}{type}=~/percentage/; $data_stacked[$count]+=$data; #$data=$data_stacked[$count] if $self->{ENV}{type}=~/stacked/; if ($self->{ENV}{type}=~/stacked/) { if ($self->{ENV}{type}=~/percentage/) { #$data_w="$data_o(".((int($data*100))/100)."%)"; $data_w=((int($data*100))/100)."%"; $data=100-$data_stacked[$count]+$data; } else { #$data=$self->GetRowSum($count-1)-$data_stacked[$count]+$data; $data=$self->GetRowSum($row)-$data_stacked[$count]+$data; } } my $height=(($data-$self->{grid_y_scale_minimum})/($self->{grid_y_scale}/100))*($self->{block_height}/100); $height=int($height*100)/100; $height=0 if $height < 0; $height=$self->{block_height} if $height > $self->{block_height}; my $width=($count-1)*($self->{block_width}/($self->{grid_x_main_lines}-1)); $width+=($count*10); print "mam $count\n"; $width=int($width*100)/100; $self->{SVG}->polyline( points => ($self->{block_left}+$width).",".($self->{block_down})." ". ($self->{block_left}+$width+10).",".($self->{block_down})." ". ($self->{block_left}+$width+10).",".($self->{block_down}-$height)." ". ($self->{block_left}+$width).",".($self->{block_down}-$height)." ". ($self->{block_left}+$width).",".($self->{block_down})." ", 'stroke-width' =>"1.5pt", 'stroke' =>"black", # 'stroke-' =>"black", 'stroke-linecap' =>"round", 'stroke-linejoin' =>"round", 'fill' =>"rgb(".$colors{N0}.")", 'fill-opacity' =>"0.5", # 'stroke-linecap'=>"square", ); } }
To install SVGraph, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SVGraph
CPAN shell
perl -MCPAN -e shell install SVGraph
For more information on module installation, please visit the detailed CPAN module installation guide.