- 作者:zhaozj
- 发表时间:2020-12-23 10:58
- 来源:未知
画走势图,此类是根据提交的数据信息输出VML代码,产生VML图。此类可以画多条走线,算是较完美的代码吧,但就是不太美观。呵呵类的源代码(drawclass.asp)<%'======================================'类名:画走势图的类'======================================Class DrawClassdim D_ColData,D_LowDatadim PicWidth,PicHeight,PicLeft,PicTopdim X,Ydim D_Infodim LowUbdim D_isShowTipdim D_BoxData,Highest,Lowestdim D_Positiondim D_TipColor,D_InfoColor,D_TitleColordim D_BoxColor,D_LineColor,D_BgColordim D_LineType,D_Type'======================================'函数功能:初始类'======================================Private Sub Class_Initialize D_ColData="" D_LowData="" PicWidth=520 PicHeight=200 PicLeft=0 LowUb=10 D_Info="" D_isShowTip=false Highest=0 Lowest=0 D_BoxData="" D_Position="left" D_TipColor="#0000FF" D_InfoColor="#FF0000" D_TitleColor="#FF0000" D_BoxColor="#000000" D_LineColor="#AAAAAA" D_BgColor="#D7EEFF" D_LineType="Solid" D_Type="1"End Sub'======================================'函数功能:释放类'======================================Private Sub Class_Terminate D_ColData="" D_LowData="" D_Info="" D_BoxData=""End Sub
'======================================'以下函数对ColData和LowData变量赋值和取值'外部用法:obj.LowData="1,1,22,3,4,4'外部用法:obj.ColData="1,1,22,11,3"'外部用法:obj.Title="[2002年走势图]'======================================'走势图的横纵坐标的数据Public Property Let LowData(bNewValue) D_LowData=bNewValueEnd PropertyPublic Property Get LowData LowData=D_LowDataEnd PropertyPublic Property Let ColData(bNewValue) D_ColData = bNewValueEnd PropertyPublic Property Get ColData ColData =D_ColDataEnd Property'走势图的名称Public Property Let Title(bNewValue) D_Info = bNewValueEnd PropertyPublic Property Get Title Title = D_InfoEnd Property'走势图的高宽设置Public Property Let Width(bNewValue) PicWidth = bNewValueEnd PropertyPublic Property Get Width Width = PicWidthEnd PropertyPublic Property Let Height(bNewValue) PicHeight = bNewValueEnd PropertyPublic Property Get Height Height = PicHeightEnd PropertyPublic Property Let Left(bNewValue) PicLeft = bNewValueEnd PropertyPublic Property Get Left Left = PicLeftEnd PropertyPublic Property Let Top(bNewValue) PicTop = bNewValueEnd PropertyPublic Property Get Top Top = PicTopEnd Property'走势图的显示文字颜色Public Property Let TipColor(bNewValue) D_TipColor = bNewValueEnd PropertyPublic Property Get TipColor TipColor = D_TipColorEnd PropertyPublic Property Let InfoColor(bNewValue) D_InfoColor = bNewValueEnd PropertyPublic Property Get InfoColor InfoColor = D_InfoColorEnd PropertyPublic Property Let TitleColor(bNewValue) D_TitleColor = bNewValueEnd PropertyPublic Property Get TitleColor TitleColor = D_TitleColorEnd Property'走势图的线和边框颜色Public Property Let BoxColor(bNewValue) D_BoxColor = bNewValueEnd PropertyPublic Property Get BoxColor BoxColor = D_BoxColorEnd PropertyPublic Property Let LineColor(bNewValue) D_LineColor = bNewValueEnd PropertyPublic Property Get LineColor LineColor = D_LineColorEnd PropertyPublic Property Let LineType(bNewValue) select case bNewValue case 1 D_LineType = "Dot" case 2 D_LineType = "DashDot" case else D_LineType = "Solid" end selectEnd PropertyPublic Property Get LineType LineType = D_LineTypeEnd Property'设置显示页面的背景颜色Public Property Let BgColor(bNewValue) D_BgColor = bNewValueEnd PropertyPublic Property Get BgColor BgColor = D_BgColorEnd Property'走势图的纵坐标的标签显示位置'值为left或1则是左边,否则是右边Public Property Let TipPosition(bNewValue) select case lcase(cstr(bNewValue)) case "left","1" D_Position="left" case else D_Position="right" end selectEnd PropertyPublic Property Get TipPosition TipPosition = D_PositionEnd Property'是否显示坐标的提示Public Property Let showTip(bNewValue) D_isShowTip = bNewValueEnd PropertyPublic Property Get showTip showTip = D_isShowTipEnd Property'走势图的边框参数,接收字符串和数组Public Property Let BoxData(bNewValue) D_BoxData = bNewValueEnd PropertyPublic Property Get BoxData BoxData = D_BoxDataEnd Property'走势图的样式 值:1 普通带箭头的, 2 矩形包围Public Property Let sType(bNewValue) select case cstr(bNewValue) case "2" D_Type="2" case else D_Type="1" end selectEnd PropertyPublic Property Get sType sType = D_TypeEnd Property'======================================='函数功能:显示HTML语句头'=======================================Private Sub ShowHead()%><HTML xmlns:v><HEAD><STYLE>v/:*{behavior:url(#default#VML);}*{font-size:12px}</STYLE></HEAD><BODY topmargin="0" leftmargin="0" bgcolor="<%=D_BgColor%>"><DIV id=showdiv style="font-size:12px; Color:RED; DISPLAY: none; LEFT: 0px; PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px; POSITION: absolute; TABLE-LAYOUT: fixed; TOP: 0px; WHITE-SPACE: nowrap; Z-INDEX: 500"></DIV><script language="javascript"><!--//加速alt,title的显示var oldtext="abc";function window.onload(){try{myid2.height=window.document.body.scrollHeight}catch(e){}}function document.onmousemove(){try{if(event.srcElement.getAttribute('onMOver')){showdiv.style.left=event.x-3;showdiv.style.top=event.y+document.body.scrollTop+18;if(event.srcElement.onMOver!=oldtext){oldtext=event.srcElement.onMOver;showdiv.innerText=oldtext;showdiv.style.backgroundColor='#FFF6FF'};if(showdiv.style.display=='none')showdiv.style.display=''if(showdiv.style.posLeft+300>screen.width){showdiv.style.posLeft=520}}else{if(showdiv.style.display=='')showdiv.style.display='none';}}catch(e){}}//--></SCRIPT><?xml:namespace prefix=v /><%End Sub