<%
function table2(total,table_x,table_y,all_width,all_height,line_no)
'参数含义(传递的数组,横坐标,纵坐标,图表的宽度,图表的高度,折线条数)
'纯ASP代码生成图表函数2——折线图
'@version:2.0
'@brief: 增加负数支持,并修正小数不能正常显示的BUG, 增加部分注释
'@date: 10/29/2010
'@author: 李玉宝(yubaolee/.cpp/anglecloudy)
'@contact BaiDuHI: http://hi.baidu.com/anglecloudy
' javaeye:http://dotcpp.iteye.com
' cnblogs: http://www.cnblogs.com/dotcpp
'@remarks:
' 数组情况分布:【!ASP中dim[m][n],有[m+1]*[n+1]个元素!】
' total[0][0]未使用 第一行为线条信息,第一列为X轴显示的内容
' ________________________________
' | NULL| 线条的颜色等信息 |
' -------------------------------|
' | x | |
' | 轴 | 曲线内容 |
' | | |
' --------------------------------
'
'
'作者:龚鸣(Passwordgm) QQ:25968152 MSN:passwordgm@sina.com Email:passwordgm@sina.com
'本人非常愿意和ASP,VML,FLASH的爱好者在HTTP://topclouds.126.com进行交流和探讨
'版本1.0 2003-8-11
'非常感谢您使用这个函数,请您使用和转载时保留版权信息,这是对作者工作的最好的尊重。
line_color="#69f"
left_width=70
total_no=ubound(total,1)
temp1=0 'save the maximum value
minvalue = 0 'save the minimum value
for i=1 to total_no
for j=1 to line_no
if temp1<int(total(i,j)) then temp1=int(total(i,j))
if minvalue > int(total(i,j)) then minvalue = int(total(i,j))
next
next
'caculate the y axis max value, and save it to temp3
if temp1>9 then
temp2=mid(cstr(temp1),2,1)
if temp2>5 then
temp3=(int(temp1/(10^(len(cstr(temp1))-1)))+1)*10^(len(cstr(temp1))-1)
else
temp3=(int(temp1/(10^(len(cstr(temp1))-1)))+0.5)*10^(len(cstr(temp1))-1)
end if
else
if temp1>4 then temp3=10 else temp3=5
end if
'if the minimum value is minus, you should caculate the y axis min value, and save it to mintemp3
mintemp3 = 0
if minvalue<0 then
minvalue = -minvalue
if minvalue > 9 then
mintemp2 = mid(cstr(minvalue),2,1)
if(mintemp2 > 5) then
mintemp3=(int(minvalue/(10^(len(cstr(minvalue))-1)))+1)*10^(len(cstr(minvalue))-1)
else
mintemp3=(int(minvalue/(10^(len(cstr(minvalue))-1)))+0.5)*10^(len(cstr(minvalue))-1)
end if
else
if minvalue> 4 then mintemp3= 10 else mintemp3=5
end if
minvalue = -minvalue
mintemp3 = -mintemp3
end if
temp4=temp3
response.write "<v:rect id='_x0000_s1027' alt='' style='position:absolute;left:"&table_x+left_width&"px;top:"&table_y&"px;width:"&all_width&"px;height:"&all_height&"px;z-index:-1' fillcolor='#9cf' stroked='f'><v:fill rotate='t' angle='-45' focus='100%' type='gradient'/></v:rect>"
for i=0 to all_height-1 step all_height/20
response.write "<v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='"&table_x+left_width+length&"px,"&table_y+all_height-length-i&"px' to='"&table_x+all_width+left_width&"px,"&table_y+all_height-length-i&"px' strokecolor='"&line_color&"'/>"
response.write "<v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='"&table_x+(left_width-15)&"px,"&table_y+i&"px' to='"&table_x+left_width&"px,"&table_y+i&"px'/>"
response.write ""
response.write "<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:"&table_x&"px;top:"&table_y+i&"px;width:"&left_width&"px;height:18px;z-index:1'>"
response.write "<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='right'>"&temp4&"</td></tr></table></v:textbox></v:shape>"
temp4=temp4-(temp3-mintemp3)/20 'the per step of y axis is (temp3-mintemp3)/20
next
response.write "<v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='"&table_x+left_width&"px,"&table_y+all_height&"px' to='"&table_x+all_width+left_width&"px,"&table_y+all_height&"px'/>"
response.write "<v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='"&table_x+left_width&"px,"&table_y&"px' to='"&table_x+left_width&"px,"&table_y+all_height&"px'/>"
dim line_code
redim line_code(line_no,5)
for i=1 to line_no
line_temp=split(total(0,i),",")
line_code(i,1)=line_temp(0)
line_code(i,2)=line_temp(1)
line_code(i,3)=line_temp(2)
line_code(i,4)=line_temp(3)
line_code(i,5)=line_temp(4)
next
for j=1 to line_no
for i=1 to total_no-2
x1=table_x+left_width+all_width*(i-1)/total_no
y1=table_y+(temp3-total(i,j))*(all_height/(temp3-mintemp3))
x2=table_x+left_width+all_width*i/total_no
y2=table_y+(temp3-total(i+1,j))*(all_height/(temp3-mintemp3))
'draw specific lines and illustrating of every color meaning
response.write "<v:line id=""_x0000_s1025"" alt="""" style='position:absolute;left:0;text-align:left;top:0;z-index:1' from="""&x1&"px,"&y1&"px"" to="""&x2&"px,"&y2&"px"" coordsize=""21600,21600"" strokecolor="""&line_code(j,1)&""" strokeweight="""&line_code(j,2)&""">"
' check line type
select case line_code(j,3)
case 1
case 2
response.write "<v:stroke dashstyle='1 1'/>"
case 3
response.write "<v:stroke dashstyle='dash'/>"
case 4
response.write "<v:stroke dashstyle='dashDot'/>"
case 5
response.write "<v:stroke dashstyle='longDash'/>"
case 6
response.write "<v:stroke dashstyle='longDashDot'/>"
case 7
response.write "<v:stroke dashstyle='longDashDotDot'/>"
case else
end select
response.write "</v:line>"&CHR(13)
select case line_code(j,4)
case 1
case 2
response.write "<v:rect id=""_x0000_s1027"" style='position:absolute;left:"&x1-2&"px;top:"&y1-2&"px;width:4px;height:4px; z-index:2' fillcolor="""&line_code(j,1)&""" strokecolor="""&line_code(j,1)&"""/>"&CHR(13)
case 3
response.write "<v:oval id=""_x0000_s1026"" style='position:absolute;left:"&x1-2&"px;top:"&y1-2&"px;width:4px;height:4px;z-index:1' fillcolor="""&line_code(j,1)&""" strokecolor="""&line_code(j,1)&"""/>"&CHR(13)
end select
next
select case line_code(j,4)
case 1
case 2
response.write "<v:rect id=""_x0000_s1027"" style='position:absolute;left:"&x2-2&"px;top:"&y2-2&"px;width:4px;height:4px; z-index:2' fillcolor="""&line_code(j,1)&""" strokecolor="""&line_code(j,1)&"""/>"&CHR(13)
case 3
response.write "<v:oval id=""_x0000_s1026"" style='position:absolute;left:"&x2-2&"px;top:"&y2-2&"px;width:4px;height:4px;z-index:1' fillcolor="""&line_code(j,1)&""" strokecolor="""&line_code(j,1)&"""/>"&CHR(13)
end select
next
'show the value of x axis
for i=1 to total_no
response.write "<v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='"&table_x+left_width+all_width*(i-1)/total_no&"px,"&table_y+all_height&"px' to='"&table_x+left_width+all_width*(i-1)/total_no&"px,"&table_y+all_height+15&"px'/>"
response.write ""
response.write "<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:"&table_x+left_width+all_width*(i-1)/total_no&"px;top:"&table_y+all_height&"px;width:"&all_width/total_no&"px;height:18px;z-index:1'>"
response.write "<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='left'>"&total(i,0)&"</td></tr></table></v:textbox></v:shape>"
next
tb_height=30
response.write "<v:rect id='_x0000_s1025' style='position:absolute;left:"&table_x+all_width+20&"px;top:"&table_y&"px;width:100px;height:"&line_no*tb_height+20&"px;z-index:1'/>"
for i=1 to line_no
response.write "<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:"&table_x+all_width+25&"px;top:"&table_y+10+(i-1)*tb_height&"px;width:60px;height:"&tb_height&"px;z-index:1'>"
response.write "<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='left'>"&line_code(i,5)&"</td></tr></table></v:textbox></v:shape>"
response.write "<v:rect id='_x0000_s1040' alt='' style='position:absolute;left:"&table_x+all_width+80&"px;top:"&table_y+10+(i-1)*tb_height+4&"px;width:30px;height:20px;z-index:1' fillcolor='"&line_code(i,1)&"'><v:fill color2='"&line_code(i,1)&"' rotate='t' focus='100%' type='gradient'/></v:rect>"
next
end function
%>
调用:
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<!--[if !mso]>
<style>
v\:* { behavior: url(#default#VML) }
o\:* { behavior: url(#default#VML) }
.shape { behavior: url(#default#VML) }
</style>
<![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<style>
TD { FONT-SIZE: 9pt}
</style></head>
<body topmargin=5 leftmargin=0 scroll=AUTO>
<script language=javascript>
//=============调用方法=====================
var nameArray = new Array();
nameArray[0]="中国经营报"
nameArray[1]="招聘网"
nameArray[2]="51Job"
nameArray[3]="新民晚报"
nameArray[4]="新闻晚报"
nameArray[5]="南方周末"
nameArray[6]="羊城晚报"
var dataArray1 = new Array()
dataArray1[0]="#FF0000,1.5,1,2,公司1"//参数1线条的颜色,参数2线条的宽度,参数3线条的类型,参数4转折点的类型,参数5线条名称
dataArray1[1]=200.3
dataArray1[2]=40.33
dataArray1[3]=-200
dataArray1[4]=-600
dataArray1[5]=1222
dataArray1[6]=413
dataArray1[7]=800
var dataArray2 = new Array()
dataArray2[0]="#0000FF,1,2,3,公司2"
dataArray2[1]=-200
dataArray2[2]=500
dataArray2[3]=1040
dataArray2[4]=1600
dataArray2[5]=522
dataArray2[6]=813
dataArray2[7]=980
var dataArray3 = new Array()
dataArray3[0]="#004D00,1,1,3,公司3"
dataArray3[1]=300.33
dataArray3[2]=890
dataArray3[3]=1240
dataArray3[4]=40.25
dataArray3[5]=722
dataArray3[6]=833
dataArray3[7]=1280
var total = new Array(nameArray,dataArray1,dataArray2,dataArray3)
table2(total,100,90,600,250,3);
</script>
</body>
</html>
分享到:
相关推荐
function table2(total,table_x,table_y,all_width,all_height,line_no) ‘参数含义(传递的数组,横坐标,纵坐标,图表的宽度,图表的高度,折线条数) ‘纯ASP代码生成图表函数2——折线图 ‘作者:龚鸣(Passwordgm...
这个数据集提供了2010年至2021年间加拿大各省的家庭支出与收入数据,这些数据根据人口统计和地理指标进行了分类。每行代表了年份(REF_DATE)、省份(GEO)以及编码后的支出或收入类型的唯一组合(COORDINATE)。以下是该数据集的关键特点及包含的列信息: 关键特点: 支出数据:家庭支出按照收入五分位数和支出类别进行分类。 收入数据:家庭收入值根据家庭类型、较年长成年人的年龄组别和收入水平细分。 地理位置匿名化:为了保护隐私,原始的地理位置标识符被替换为如“Province 1”这样的标签。 时间序列:涵盖了超过十年的财务数据(2010–2021),适合用于纵向经济和社会趋势分析。 包含的列: REF_DATE:记录年份(2010–2021) GEO:省份标签(例如,“Province 1”) Statistic:度量类型(例如,平均家庭支出) Before-tax household income quintile:税前家庭收入水平分组 Household expenditures, summary-level categories:支出类别 UOM:计量单位 COORD
1.【锂电池剩余寿命预测】GRU门控循环单元锂电池剩余寿命预测(Matlab完整源码和数据) 2.数据集:NASA数据集,已经处理好,B0005电池训练、测试; 3.环境准备:Matlab2023b,可读性强; 4.模型描述:GRU门控循环单元在各种各样的问题上表现非常出色,现在被广泛使用。 5.领域描述:近年来,随着锂离子电池的能量密度、功率密度逐渐提升,其安全性能与剩余使用寿命预测变得愈发重要。本代码实现了GRU门控循环单元在该领域的应用。 6.作者介绍:机器学习之心,博客专家认证,机器学习领域创作者,2023博客之星TOP50,主做机器学习和深度学习时序、回归、分类、聚类和降维等程序设计和案例分析,文章底部有博主联系方式。从事Matlab、Python算法仿真工作8年,更多仿真源码、数据集定制私信。
2000-2024年各省专利侵权案件结案数数据 1、时间:2000-2024年 2、来源:国家知识产权J 3、指标:专利侵权案件结案数 4、范围:31省 5、用途:可用于衡量知识产权保护水平
- 使用`<div>` 容器组织游戏界面,包含得分显示、游戏画布和操作按钮 - 支持三种游戏模式选择(一般模式、困难模式、无敌模式) - 移动端和桌面端兼容,提供触摸和键盘两种控制方式 2. CSS样式 : - 采用Flex布局实现页面居中显示 - 使用Grid布局实现方向按钮的排列 - 定义了游戏容器的阴影、圆角等视觉效果 - 为按钮添加了hover效果和过渡动画 3. JavaScript逻辑 : - 使用Canvas API实现游戏渲染 - 实现了蛇的移动、食物生成、碰撞检测等核心游戏逻辑 - 支持三种游戏模式,不同模式对应不同的游戏速度和规则 - 使用localStorage保存最高分记录 - 实现随机颜色生成,使游戏更具趣味性 代码整体结构清晰,功能完整,具有良好的可扩展性和可维护性。
台区终端电科院送检文档
内容概要:本文详细介绍了一个基于强化学习(RL)的飞机升阻力特性预测模型的实现过程。首先,定义了飞机空气动力学环境,包括状态空间、动作空间以及目标——预测升力系数(Cl)和阻力系数(Cd)。接着,通过生成模拟数据并进行预处理,创建了用于训练的数据集。然后,构建了一个神经网络代理模型,用于联合编码状态和动作,并预测升阻力系数。最后,实现了PPO算法来训练强化学习代理,使其能够根据当前状态选择最优动作,并通过不断迭代提高预测精度。文中还提供了完整的代码实现和详细的注释。 适合人群:航空航天领域的研究人员、机器学习工程师、对强化学习感兴趣的开发者。 使用场景及目标:适用于需要预测飞机升阻力特性的应用场景,如飞行器设计优化、性能评估等。目标是通过强化学习方法提升预测模型的准确性,从而为实际工程提供可靠的理论支持和技术手段。 其他说明:本文不仅涵盖了模型的设计与实现,还包括了数据生成、预处理等多个环节,有助于读者全面理解整个建模过程。同时,提供的代码可以作为研究和开发的基础,方便进一步扩展和改进。
cmock ut aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
lsm6d datasheet
风力发电机传动机构的设计(增速器)
genesys-zu(5ev)配置petalinux(从安装到嵌入)
django自建博客app
Android项目原生java语言课程设计,包含LW+ppt
幼儿园预防肺结核教育培训课件资料
STM32F103RCT6单片机控制气泵和电磁阀的开关 1、气泵和电磁阀的开和关均为开关量,实现控制方法有多种,比如继电器,但是继电器动作有噪声且体积较大,更好的方法为使用mos管。 2、mos管的选型:mos管选择主要注意两个参数即可,一是导通的电流,二是耐压值,并且常用NMOS管,根据要求,气泵和电磁阀供电电压为12V,所以选择的mos管耐压值要大于12V,这里选用耐压值为30V的MOS管,并且导通电流为5.8A。
因文件较多,数据存放网盘,txt文件内包含下载链接及提取码,永久有效。失效会第一时间进行补充。样例数据及详细介绍参见文章:https://blog.csdn.net/T0620514/article/details/146916073
将 Windows 系统中 “C:\windows\fonts” 目录下的所有字体文件
智能量测终端最新标准
滑道式提升机及其控制电路的设计.zip