ASP generated column body, line chart, pie chart source code provides the 1th/3 page _ Application Tips

Source: Internet
Author: User
Tags chr
ASP generated column form, line chart, pie chart source code
<%
function Table2 (total,table_x,table_y,all_width,all_height,line_no)
' parameter meaning (passed array, horizontal axis, ordinate, chart width, chart height, fold line number)
' Pure ASP code generation chart function 2--line chart
' Author: 龚鸣 (PASSWORDGM) qq:25968152 msn:passwordgm@sina.com email:passwordgm@sina.com
I am very willing to communicate and discuss with Asp,vml,flash enthusiasts in HTTP://topclouds.126.com.
' Version 1.0 last modification date 2003-8-11
' Thank you very much for using this function, please keep the copyright information when you use and reprint, which is the best respect for the author's work.

Line_color= "#69f"
Left_width=70
Total_no=ubound (total,1)

Temp1=0
For I=1 to Total_no
For J=1 to Line_no
If Temp1<total (i,j) then Temp1=total (i,j)
Next
Next
Temp1=int (TEMP1)
If Temp1>9 Then
Temp2=mid (CStr (TEMP1), 2, 1)
If Temp2>4 Then
temp3= (int (temp1/(10^ len (TEMP1)-1)) +1) *10^ (Len (CStr (TEMP1))-1)
Else
temp3= (int (temp1/(10^ len (TEMP1)-1)) +0.5) *10^ (Len (CStr (TEMP1))-1)
End If
Else
If Temp1>4 then temp3=10 else temp3=5
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/5
Response.Write "<v:line id= ' _x0000_s1027 ' alt= ' style= '; 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= '; 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/5
Next
Response.Write "<v:line id= ' _x0000_s1027 ' alt= ' style= '; 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= '; 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-1
x1=table_x+left_width+all_width* (i-1)/total_no
y1=table_y+ (Temp3-total (I,J)) * (All_height/temp3)
X2=table_x+left_width+all_width*i/total_no
y2=table_y+ (Temp3-total (I+1,J)) * (All_height/temp3)
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) &" ">"
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>" &AMP;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) &" "/>" &AMP;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) & "" "/>" &AMP;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) &" "/>" &AMP;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) & "" "/>" &AMP;CHR (13)
End Select
Next

For I=1 to Total_no
Response.Write "<v:line id= ' _x0000_s1027 ' alt= ' style= '; 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= ':" &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
%>
Current 1/3 page 123 Next read the full text
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.