PHP实现立体3D效果的饼状统计图

//如果要轉載本文請注明出處,免的出現版權紛爭,我不喜歡看到那種轉載了我的作品卻不注明出處的人 Seven{See7di#Gmail.com}

<?php

//转载请标注:制作人Seven(QQ9256114)
//参数含义(数组,横坐标,纵坐标,图表的宽度,图表的高度,图表标题,单位)
Function table2($stat_array,$table_left,$table_top,$all_width,$all_height,$table_title,$unit){
$num =Count($stat_array);

For($i=0;$i<$num;$i++){
Static $allvalues=0;
$allvalues = $allvalues+$stat_array[$i][0];
}

$pie=Array();
For($i=0;$i<$num;$i++){
Static $k=0;
$pie[$i]=Round($stat_array[$i][0]/$allvalues,2);
$k=$k+$pie[$i];
}

$pie[$num]=Round((1-$k),2);

Echo "<v:shapetype id='Cake_3D' coordsize='21600,21600' o:spt='95' adj='11796480,5400' path='al10800,10800@0@0@2@14,10800,10800,10800,10800@3@15xe'></v:shapetype>";

Echo "<v:shapetype id='3dtxt' coordsize='21600,21600' o:spt='136' adj='10800' path='m@7,l@8,m@5,21600l@6,21600e'> ";
Echo "<v:path textpathok='t' o:connecttype='custom' o:connectlocs='@9,0;@10,10800;@11,21600;@12,10800' o:connectangles='270,180,90,0'/>";
Echo "<v:textpath on='t' fitshape='t'/>";
Echo "<o:lock v:ext='edit' text='t' shapetype='t'/>";
Echo "</v:shapetype>";

Echo "<v:rect id='background' style='position:absolute;left:".$table_left."px;top:".$table_top."px;WIDTH:".$all_width."px;HEIGHT:".$all_height."px;' fillcolor='#EFEFEF' strokecolor='gray'>";
Echo "<v:shadow on='t' type='single' color='silver' offset='4pt,4pt'/>";
Echo "</v:rect>";

Echo "<v:group ID='table' style='position:absolute;left:".$table_left."px;top:".$table_top."px;WIDTH:"

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

www_7di_net

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值