免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2042 | 回复: 1
打印 上一主题 下一主题

条形图显示Problem--solved temporaryly [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-11-14 14:37 |只看该作者 |倒序浏览
没想出折怎么让条形图就显示在横坐标区间而不是横坐标那个点上。

#!/usr/bin/perl -w
use CGI ':standard';
use GD::Graph::bars;
use strict;

my @data=(['100','200','300'],
          [10,15,20]);  
                                                                             
my $graph = GD::Graph::bars->new(500,300);                                                                              
      $graph ->set(
       x_label =>'x_label ',
       y_label =>'y_label ',
       title   =>'title',
       #Draw bars with width 3 pixels
       bar_width =>3,
       #Seperate the bars with 4 pixels
       bar_spacing =>4,
       #Show the grid
       y_long_ticks =>1,
       #y_tick_number =>2,
       #Show values on top of each bar
       show_values =>1,
       transparent  => 1,
) or warn $graph->error;

my  $myimage = $graph->plot(\@data) or die $graph->error;                                                                              
print "Contents-type:image/jpeg\n\n";
print $myimage->jpeg;

As the attached screenshot, how to make the bar chart display between 0~100, 100~200, 200~300 but not on middle of 100...

Thanks for any response!

是不是我没讲清楚?
我想要这样的效果图:

[ 本帖最后由 biginner 于 2007-11-15 10:16 编辑 ]

bar.jpeg (12 KB, 下载次数: 41)

bar.jpeg

ideabar.JPG (13.91 KB, 下载次数: 29)

ideabar.JPG

ideabar.JPG (13.91 KB, 下载次数: 29)

ideabar.JPG

bar.jpeg (13.73 KB, 下载次数: 33)

原图

原图

论坛徽章:
0
2 [报告]
发表于 2007-11-15 10:09 |只看该作者
my @data=(['100','200','300'],
          [10,15,20]
          []);

Get it!

Thanks for your overview.  Please let me know if have any good suggestion .

[ 本帖最后由 biginner 于 2007-11-15 12:47 编辑 ]
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP