asp生成三维饼图的函数

为方便生成三维饼图函数,我收集了asp下的生成三维饼图的函数的代码,方便大家特殊情况下的使用

复制代码 代码如下:

<%

'参数含义(数组,横坐标,纵坐标,图表的宽度,图表的高度,图表标题,单位)

function table2(stat_array,table_left,table_top,all_width,all_height,table_title,unit)

       dim bg_color(10),pie(10)

       bg_color(1)="#ff1919"

       bg_color(2)="#ffff19"

       bg_color(3)="#1919ff"

       bg_color(4)="#19ff19"

       bg_color(5)="#fc0"

       bg_color(6)="#3cc"

       bg_color(7)="#ff19ff"

       bg_color(8)="#993300"

       bg_color(9)="#f60"

       bg_color(10)="#ff8c19"

       num =ubound(stat_array,1)

       allvalues=0

       for i=1 to num

              allvalues = allvalues+stat_array(i,1)

       next

       k=0

       for i=1 to num-1

              pie(i)=formatnumber(stat_array(i,1)/allvalues,4,-1)

              k=k+pie(i)

       next

       pie(num)=formatnumber((1-k),4,-1)

       response.Write "<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>"

       response.Write "<v:shapetype id='3dtxt' coordsize='21600,21600' o:spt='136' adj='10800' path='m@7,l@8,m@5,21600l@6,21600e'> "

       response.Write " <v:path textpathok='t' o:connecttype='custom' o:connectlocs='@9,0;@10,10800;@11,21600;@12,10800' o:connectangles='270,180,90,0'/>"

       response.Write " <v:textpath on='t' fitshape='t'/>"

       response.Write " <o:lock v:ext='edit' text='t' shapetype='t'/>"

       response.Write "</v:shapetype>"

       response.Write "<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'>"

       response.Write " <v:shadow on='t' type='single' color='silver' offset='4pt,4pt'/>"

       response.Write "</v:rect>"

       response.Write "<v:group ID='table' style='position:absolute;left:"&table_left&"px;top:"&table_top&"px;WIDTH:"&all_width&"px;HEIGHT:"&all_height&"px;' coordsize = '21000,11500'>" 

       response.Write " <v:Rect style='position:relative;left:500;top:200;width:20000;height:800'filled='false' stroked='false'>"

       response.Write " <v:TextBox inset='0pt,0pt,0pt,0pt'>"

       response.Write " <table width='100%' border='0' align='center' cellspacing='0'>"

       response.Write " <tr>"

       response.Write " <td align='center' valign='middle'><div style='font-size:15pt; font-family:黑体;'><B>"&table_title&"</B></div></td>"

       response.Write " </tr>"

       response.Write " </table>"

       response.Write " </v:TextBox>"

       response.Write " </v:Rect> "

       response.Write " <v:rect id='back' style='position:relative;left:500;top:1000;width:20000; height:10000;' onmouseover='movereset(1)' onmouseout='movereset(0)' fillcolor='#9cf' strokecolor='#888888'>"

       response.Write " <v:fill rotate='t' angle='-45' focus='100%' type='gradient'/>"

       response.Write " </v:rect>"

       response.Write " <v:rect id='back' style='position:relative;left:15000;top:1400;width:5000; height:"&((num+1)*9000/11+200)&";' fillcolor='#9cf' stroked='t' strokecolor='#0099ff'>"

       response.Write " <v:fill rotate='t' angle='-175' focus='100%' type='gradient'/>"

       response.Write " <v:shadow on='t' type='single' color='silver' offset='3pt,3pt'/>"

       response.Write " </v:rect>"

       response.Write " <v:Rect style='position:relative;left:15500;top:1500;width:4000;height:700' fillcolor='#000000' stroked='f' strokecolor='#000000'>"

       response.Write " <v:TextBox inset='8pt,4pt,3pt,3pt' style='font-size:11pt;'><div align='left'><font color='#ffffff'><B>总数:"&allvalues&unit&"</B></font></div></v:TextBox>"

       response.Write " </v:Rect> " 

       for i=1 to num

              response.Write " <v:Rect id='rec"&i&"' style='position:relative;left:15400;top:"&i*9000/11+1450&";width:4300;height:800;display:none' fillcolor='#efefef' strokecolor='"&bg_color(i)&"'>"

              response.Write " <v:fill opacity='.6' color2='fill darken(118)' o:opacity2='.6' rotate='t' method='linear sigma' focus='100%' type='gradient'/>"

              response.Write " </v:Rect>"

              response.Write " <v:Rect style='position:relative;left:15500;top:"&i*9000/11+1500&";width:600;height:700' fillcolor='"&bg_color(i)&"' stroked='f'/>"

              response.Write " <v:Rect style='position:relative;left:16300;top:"&i*9000/11+1500&";width:3400;height:700' filled='f' stroked='f'>"

              response.Write " <v:TextBox inset='0pt,5pt,0pt,0pt' style='font-size:9pt;'><div align='left'>"&stat_array(i,2)&":"&stat_array(i,1)&unit&"</div></v:TextBox>"

              response.Write " </v:Rect> " 

       next

       response.Write "</v:group>"

       k1=180

       k4=10

       for i=1 to num

response.write "<a href=aaa.asp>"

              k2=360*pie(i)/2

              k3=k1+k2

              if k3>=360 then

                     k3=k3-360

              end if

              kkk=(-11796480*pie(i)+5898240)

              k5=3.1414926*2*(180-(k3-180))/360

              R=all_height/2

              txt_x = table_left+all_height/8-30+R+R*sin(k5)*0.7

              txt_y = table_top+all_height/14-39+R+R*cos(k5)*0.7*0.5

              titlestr = "名称:"&stat_array(i,2)&" 数值:"&stat_array(i,1)&unit&" 所占比例:"&pie(i)*100&"%"

              response.Write " <div style='cursor:hand;'>"

              response.Write " <v:shape id='cake"&i&"' type='#Cake_3D' title='"&titlestr&"'"

              response.Write " style='position:absolute;left:"&table_left+all_height/8&"px;top:"&table_top+all_height/14&"px;WIDTH:"&all_height&"px;HEIGHT:"&all_height&"px;rotation:"&k3&";z-index:"&k4&"'"

              response.Write " adj='"&kkk&",0' fillcolor='"&bg_color(i)&"' onmouseover='moveup(cake"&i&","&(table_top+all_height/14)&",txt"&i&",rec"&i&")'; onmouseout='movedown(cake"&i&","&(table_top+all_height/14)&",txt"&i&",rec"&i&");'>"

              response.Write " <v:fill opacity='60293f' color2='fill lighten(120)' o:opacity2='60293f' rotate='t' angle='-135' method='linear sigma' focus='100%' type='gradient'/>"

              response.Write " <o:extrusion v:ext='view' on='t'backdepth='25' rotationangle='60' viewpoint='0,0'viewpointorigin='0,0' skewamt='0' lightposition='-50000,-50000' lightposition2='50000'/>"

              response.Write " </v:shape>"

              response.Write " <v:shape id='txt"&i&"' type='#3dtxt' style='position:absolute;left:"&txt_x&"px;top:"&txt_y&"px;z-index:20;display:none;width:50; height:18;' fillcolor='#ffffff'"

              response.Write " onmouseover='ontxt(cake"&i&","&(table_top+all_height/14)&",txt"&i&",rec"&i&")'>"

              response.Write " <v:fill opacity='60293f' color2='fill lighten(120)' o:opacity2='60293f' rotate='t' angle='-135' method='linear sigma' focus='100%' type='gradient'/>"

              response.Write " <v:textpath style='font-family:'宋体';v-text-kern:t' trim='t' fitpath='t' string='"&pie(i)*100&"%'/>"

              response.Write " <o:extrusion v:ext='view' backdepth='8pt' on='t' lightposition='0,0' lightposition2='0,0'/>"

              response.Write " </v:shape>" 

              response.Write " </div>"

              k1=k1+k2*2

              if k1>=360 then

                     k1=k1-360

              end if

              if k1>180 then

                     k4=k4+1

              else

                     k4=k4-1

              end if

response.write "</a>"

       next

end function

%>

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">

<head>

<title></title>

<STYLE>

v\:* { Behavior: url(#default#VML) }

o\:* { behavior: url(#default#VML) }

</STYLE>

</head>

<body>

<SCRIPT LANGUAGE="JavaScript">

<!--

onit=true

num=0

function moveup(iteam,top,txt,rec){

temp=eval(iteam)

tempat=eval(top)

temptxt=eval(txt)

temprec=eval(rec)

at=parseInt(temp.style.top)

temprec.style.display = ""; 

if (num>27){

temptxt.style.display = "";

}

if(at>(tempat-28)&&onit){

num++

temp.style.top=at-1

Stop=setTimeout("moveup(temp,tempat,temptxt,temprec)",10)

}else{

return



}

function movedown(iteam,top,txt,rec){

temp=eval(iteam)

temptxt=eval(txt)

temprec=eval(rec)

clearTimeout(Stop)

temp.style.top=top

num=0

temptxt.style.display = "none";

temprec.style.display = "none";

}

function ontxt(iteam,top,txt,rec){

temp = eval(iteam);

temptxt = eval(txt);

temprec = eval(rec)

if (onit){

temp.style.top = top-28;

temptxt.style.display = "";

temprec.style.display = "";

}

}

function movereset(over){

if (over==1){

onit=false

}else{

onit=true

}

}

-->

</script>

<%

dim total(10,2)

total(1,1)=2000

total(2,1)=1800

total(3,1)=1700

total(4,1)=1500

total(5,1)=1222

total(6,1)=1100

total(7,1)=1000

total(8,1)=800

total(9,1)=700

total(10,1)=600

total(1,2)="项目1"

total(2,2)="项目2"

total(3,2)="项目3"

total(4,2)="项目4"

total(5,2)="项目5"

total(6,2)="项目6"

total(7,2)="项目7"

total(8,2)="项目8"

total(9,2)="项目9"

total(10,2)="项目10"

call table2(total,120,20,900,500,"三维饼状图","元")

'参数含义(数组,横坐标,纵坐标,图表的宽度,图表的高度,图表标题,单位)

%>

时间: 2024-07-31 16:37:37

asp生成三维饼图的函数的相关文章

asp生成三维饼图的函数_应用技巧

为方便生成三维饼图函数,我收集了asp下的生成三维饼图的函数的代码,方便大家特殊情况下的使用 复制代码 代码如下: <% '参数含义(数组,横坐标,纵坐标,图表的宽度,图表的高度,图表标题,单位) function table2(stat_array,table_left,table_top,all_width,all_height,table_title,unit)        dim bg_color(10),pie(10)        bg_color(1)="#ff1919&q

ASP生成柱型体,折线图,饼图源代码_应用技巧

ASP生成柱型体,折线图,饼图源代码 -------------------------------------------------------------------------------- <% function table2(total,table_x,table_y,all_width,all_height,line_no) '参数含义(传递的数组,横坐标,纵坐标,图表的宽度,图表的高度,折线条数) '纯ASP代码生成图表函数2--折线图 '作者:龚鸣(Passwordgm) QQ

ASP生成柱型体,折线图,饼图源代码提供了第1/3页

ASP生成柱型体,折线图,饼图源代码 <% function table2(total,table_x,table_y,all_width,all_height,line_no) '参数含义(传递的数组,横坐标,纵坐标,图表的宽度,图表的高度,折线条数) '纯ASP代码生成图表函数2--折线图 '作者:龚鸣(Passwordgm) QQ:25968152 MSN:passwordgm@sina.com Email:passwordgm@sina.com '本人非常愿意和ASP,VML,FLASH

asp生成utf-8静态html页面的函数代码

用asp生成静态utf-8编码网页的代码.用fso无法生成,只有使用Adodb.Stream才可以生成真正的UTF-8静态页 <%Dim sContent,iType,oAdossContent = ""iType = 2    '类型(1-二进制/2-文本)Set oAdos = Server.CreateObject("Adodb.Stream")With oAdos    .Type = iType    .Mode = 3    .CharSet =

asp根据表单自动生成sql语句的函数

每次在操作数据库的时候最烦的就是根据表单提交的内容写sql语句,特别是字段比较多的时候很麻烦,动不动就容易写错.所以我就写了下面的生成sql语句的函数,用了用觉得还可以. 程序代码: <% '========以下所有函数都没有加入容错机制,所以一定要保证参数的正确性======== '================参数说明================ '此Function返回的是插入数据的sql语句 '注意:使用此Function必须使form里的字段名和数据库里的字段名一致 '并且按钮不

比较ASP生成静态HTML文件的几种方法

将动态页面转换生成静态Html文件有许多好处,比如生成html网页有利于被搜索引擎收录(特别是对接受动态参数的页面).前台访问时,脱离了数据访问,减轻对数据库访问的压力,加快网页打开速度. 当然,凡事有利必有弊,生成HTML页面无形中也耗费大量的磁盘空间以存放这些静态文件,在编辑页面过程中除读写数据库外,也要读写服务器磁盘,页面样式的改动必须重新生成全部HTML文件,等等. 像很多搜索引擎,都可以提交网站的页面地址列表,动态文件的收录问题已经不算是个问题了(如google sitemap).得失

php做饼图的函数(转)

饼图|函数 php做饼图的函数作者:qdlover   发表日期:2000年9月15日   阅读次数:14-------------------------------------------------------------------------------- 再介绍一下我自己,呵呵 我是个新手,当时学php纯粹是为了应付领导哦,让我们做统计图,我本来是学asp的,突然改行很不适应,不过php功能的确很强大呀,呵呵,我都离不了他了,这不,饼图,柱型图都搞定了,可是还有很多问题我不会,还希望

如何使用ASP生成HTML文件

生成html 使用ASP生成HTML文件,共有两个页面index.htm是首页.程序比较简单,主要是用了ASP里的文件操作对象. <!--index.htm----------------------> <html><head><title>Untitled Document</title><meta http-equiv="Content-Type" content="text/html; charset=g

ASP.Net/asp 生成静态HTML页

asp.net|静态 环境:Microsoft .NET Framework SDK v1.1 OS:Windows Server 2003 中文版 ASP.Net生成静态HTML页 在Asp中实现的生成静态页用到的FileSystemObject对象! 在.Net中涉及此类操作的是System.IO 以下是程序代码 注:此代码非原创!参考别人代码 //生成HTML页   public static bool WriteFile(string strText,string strContent,