Complete Web histogram with pure ASP

Source: Internet
Author: User
Web| histogram to achieve a perfect web histogram with pure ASP
<%
Dim Total (7,2)
Total (1,1) =200
Total (2,1) =800
Total (3,1) =1000
Total (4,1) =600
Total (5,1) =1222
Total (6,1) =3213
Total (7,1) =8

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

Total_no=7
%>
<!--[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>
<link rel= "stylesheet" href= "List.css" ><body topmargin=5 leftmargin=0 scroll=no>
<%call table1 (total,20,15,470,200)%>
</body>




The above is an example of a call function, and the following is the function called


<%
function table1 (total,thickness,table_space,all_width,all_height)
' Parameter meaning (passing array, column thickness, column spacing, chart width, chart height)
' Pure ASP code generation chart function 1--bar 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-7-10
' 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.
Dim Tb_color (7,2)

Tb_color (1,1) = "#d1ffd1"
Tb_color (2,1) = "#ffbbbb"
Tb_color (3,1) = "#ffe3bb"
Tb_color (4,1) = "#cff4f3"
Tb_color (5,1) = "#d9d9e5"
Tb_color (6,1) = "#ffc7ab"
Tb_color (7,1) = "#ecffb7"

Tb_color (1,2) = "#00ff00"
Tb_color (2,2) = "#ff0000"
Tb_color (3,2) = "#ff9900"
Tb_color (4,2) = "#33cccc"
Tb_color (5,2) = "#666699"
Tb_color (6,2) = "#993300"
Tb_color (7,2) = "#99cc00"

Response.Write "<table border=0 cellpadding=0 cellspacing=0 style=border-collapse:collapse bordercolor= #111111 Width= "&all_width&" height= "&all_height&" > "
Response.Write "<tr><td width=100% height=* valign=middle><table border=0 cellpadding=0 cellspacing=0 Style=border-collapse:collapse bordercolor= ' #111111 ' width= ' 100% ' height= ' 100% ' > '
Response.Write "<tr align= ' center ' ><td width= ' height= ' 100% ' valign= '" > "
Response.Write "<table border= ' 0 ' cellpadding= ' 0 ' cellspacing= ' 0 ' style= ' border-collapse:collapse ' bordercolor= '" 111111 ' width= ' 100% ' height= ' 100% ' > '

Temp1=0
For I=1 to Total_no
If Temp1<total (i,1) then Temp1=total (i,1)
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
If Total_no>0 Then
For I=temp3 to 1 STEP-TEMP3/5
Response.Write "<tr style= ' font-size:1px;height:1px ' ><td></td><td bgcolor= ' #111111 ' width= ' 20 % ' ></td></tr> '
Response.Write "<tr align=right valign= ' top ' ><td colspan= ' 2 ' >" &i& "</td></tr>"
Next
Response.Write "</table>"
Response.Write "</td><td style= ' font-size:1px;height:1px ' bgcolor= ' #111111 ' >1</td><td width= ' "& (all_width-30) &" ' Height= ' "& (all_height-30) &" ' valign= ' bottom ' align= ' left ' > '
Response.Write "<!--[if GTE VML 1]>"

Z=9
Width=30
total_width=280
Width= (total_width-total_no*z*2)/(TOTAL_NO)
M=0
If Width>30 then width=30
M=m+1
For I=1 to Total_no
Response.Write "<v:rect id= ' _x0000_s1025 ' alt= ' style= ':"
Response.Write table_space/2+table_space* (I-1)
Response.Write "Pt;top:2px;width:" &width& "Pt;height:" & (all_height/1.41) *total (i,1)/temp3& "PT; Z-index:1 ' fillcolor= ' "&tb_color (i,2) &" ' > "
Response.Write "<v:fill color2=" "&tb_color (i,1) &"



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.