Pure ASP combined with VML to generate perfect graph-line chart

Source: Internet
Author: User
Line Chart Demo Address:
Http://61.172.255.65/dvbbs/t3/t18.asp

<%dim Total (7,3)
Total (1,0) = "China Business Report"
Total (2,0) = "Recruitment network"
Total (3,0) = "51Job"
Total (4,0) = "Xinmin Evening News"
Total (5,0) = "Evening News"
Total (6,0) = "Southern Weekend"
Total (7,0) = "Yangcheng Evening News"

Total (0,1) = "#FF0000, 1.5,1,2, Company 1" ' Parameter 1 line color, parameter 2 line width, parameter 3 line type, parameter 4 turning type, parameter 5 line name
Total (1,1) =200
Total (2,1) =1200
Total (3,1) =900
Total (4,1) =600
Total (5,1) =1222
Total (6,1) =413
Total (7,1) =800

Total (0,2) = "#0000FF, 1,2,3, Company 2"
Total (1,2) =400
Total (2,2) =500
Total (3,2) =1040
Total (4,2) =1600
Total (5,2) =522
Total (6,2) =813
Total (7,2) =980

Total (0,3) = "#004D00, 1,1,3, company 3"
Total (1,3) =900
Total (2,3) =890
Total (3,3) =1240
Total (4,3) =1300
Total (5,3) =722
Total (6,3) =833
Total (7,3) =1280

%><!--[If!mso]>
<style>
V\:* {behavior:url (#default #vml)}
O\:* {behavior:url (#default #vml)}
. Shape {Behavior:url (#default #vml)}
</style>
<! [endif]-->

<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title></title>
<style>
TD {font-size:9pt}
</style><body topmargin=5 leftmargin=0 scroll=auto>
<%call table2 (total,100,90,600,250,3)%>
</body>

<%
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& "



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.