以前的金字塔控件不能在.NET下用,写了个简单的脚本代用,和大家共享.

newmcz 2003-11-27 11:30:03
<HTML xmlns:v>
<HEAD>
<title>Pyramid_charts</title>
<STYLE> v\:* { BEHAVIOR: url(#default#VML) } </STYLE>
</HEAD>
<body MS_POSITIONING="GridLayout">
<script>
function arrayName(n) {
this.length = n;
for(var i = 1; i <= n; i++)
this[i] = 0;
return this;}


Myarray=new Array(5);
Myarray[1]="White"
Myarray[2]="red"
Myarray[3]="green"
Myarray[4]="yellow"
Myarray[5]="blue"
Myarray[6]="#55FFFF"
Myarray[7]="#A2A2A2"
Myarray[8]="#09244D"
Myarray[9]="#4A0B0B"
Myarray[10]="#41FF11"
Myarray[11]="#500463"
Myarray[12]="#F460F4"
Myarray[13]="#5BFAFA"
Myarray[14]="#856CE8"
Myarray[15]="#FA9A5B"

var f1,f2,f3,f4 //
var a1,a2,a3,b1,b2,b3 //
var x1,y1,x2,y2,x3,y3 //
var n=10 //层数
var i //
var t //
var t1 //
var col //

f1="40,350"
f2="360,350"
f3="380,340"
f4="200,20"

a1=f1
a2=f2
a3=f3

for(i=1;i<=n;i++)
{
t = (366.74*366.74*i*i)/(n*n)
t1 = (357.77*357.77*i*i)/(n*n)

x1 = (1076 + Math.sqrt(1076*1076-4*13.45*(2152000-256*t)/100))/(2*13.45)
y1 = (6920-33*x1)/16
b1=""+x1+","+y1+""

y2 = y1
x2 = (16*y2+6280)/33
b2=""+x2+","+y2+""

x3 = (2561.20 - Math.sqrt(2561.20*2561.20-4*3.37*(48662800-81*t1)/100))/(2*3.37)
y3 = (16*x3-3020)/9
b3=""+x3+","+y3+""

col = i%15+1
alert(i)
document.write ("<v:polyline title='上限:1234567890.1234\r\下限:1234567890.0000\r数量:1234567890.0000\r\t\t\t' fillcolor='"+Myarray[col]+"' points='"+a1+" "+a2+" "+b2+" "+b1+"'> </v:polyline>")
document.write ("<v:polyline title='上限:\r\下限:\r数量:\r\t\t\t' fillcolor='"+Myarray[col]+"' points='"+a2+" "+a3+" "+b3+" "+b2+"'> </v:polyline>")
document.write ("<v:line strokecolor='black' from='"+x1+","+y1+"' to='"+x2+","+y2+"'/><v:line strokecolor='black' from='"+x2+","+y2+"' to='"+x3+","+y3+"'/>")
a1=b1
a2=b2
a3=b3
}
document.write ("<v:line strokecolor='black' from=' "+f1+" ' to=' "+f4+" '/>")
//document.write ("<v:line strokecolor='black' from=' "+f1+" ' to=' "+f2+" '/>")
//document.write ("<v:line strokecolor='black' from=' "+f4+" ' to=' "+f2+" '/>")
//document.write ("<v:line strokecolor='black' from=' "+f2+" ' to=' "+f3+" '/>")
//document.write ("<v:line strokecolor='black' from=' "+f3+" ' to=' "+f4+" '/>")
</script>
</body>
</HTML>
...全文
20 回复 打赏 收藏 举报
写回复
回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
发帖
数据仓库

7374

社区成员

其他数据库开发 数据仓库
社区管理员
  • 数据仓库
加入社区
帖子事件
创建了帖子
2003-11-27 11:30
社区公告
暂无公告