作者redluna (Occlumen)
看板Perl
标题[问题] 关於GD:Graph
时间Sat Apr 12 02:53:43 2008
我要把流量的资料换成格式为png的table
资料我撷取好了
但是在show图的部份碰到了一些问题
部份程式码
my @table = ([$S_ip[0],$S_ip[1],$S_ip[2],$S_ip[3],$S_ip[4],$S_ip[5],
$S_ip[6],$S_ip[7],$S_ip[8],$S_ip[9]] ,
[$S_va[0]],[$S_va[1]], [$S_va[2]], [$S_va[3]], [$S_va[4]],
[$S_va[5]], [$S_va[6]], [$S_va[7]], [$S_va[8]], [$S_va[9]] ) ;
my $graph = GD::Graph::hbars->new(1024,768) ;
$graph -> set (
x_lable => 'Connection Pair' ,
y_lable => 'Traffic Size for TCP and UDP(bytes)' ,
tittle => 'Local Network Traffic Rank' ,
legend_spacing => 5 ,
legend_placement => 'RT' ,
show_values => 1
) or warn $graph->error ;
$graph->set_legend('maximnum','minimum','avgerage') ;
graph->plot(\@table) or die $graph->error ;
my $ext = $graph->png ;
print $graph->gd->$ext() ;
print $output->png ;
有没没大神回应一下
谢谢^^
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.113.247.105