Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5281911
  • 博文数量: 1144
  • 博客积分: 11974
  • 博客等级: 上将
  • 技术积分: 12312
  • 用 户 组: 普通用户
  • 注册时间: 2005-04-13 20:06
文章存档

2017年(2)

2016年(14)

2015年(10)

2014年(28)

2013年(23)

2012年(29)

2011年(53)

2010年(86)

2009年(83)

2008年(43)

2007年(153)

2006年(575)

2005年(45)

分类: LINUX

2009-04-16 01:24:33

 

sample93.pl

This page contains information on the GD::Graph sample sample93.pl. The generated files are shown first, with the code used to generate the charts shown down below.

Use the left-hand navigation menu to view the other samples included in the GD::Graph package, or use the links at the top to view other sections of the website.

Generated Chart

sample93.gif:


Code to generate these graphs:


use GD::Graph::pie;
require 'save.pl';

print STDERR "Processing sample93\n";

@data = (
[ qw( 1st 2nd 3rd 4th 5th 6th 7th ) ],
[ sort { $b <=> $a} (5.6, 2.1, 3.03, 4.05, 1.34, 0.2, 2.56) ]
);

$my_graph = new GD::Graph::pie( 200, 200 );

$my_graph->set(
start_angle => 90,
'3d' => 0,
label => 'Foo Bar',
# The following should prevent the 7th slice from getting a label
suppress_angle => 5,

transparent => 0,
);

$my_graph->plot(\@data);
save_chart($my_graph, 'sample93');
 
阅读(1167) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~