ASP bar chart

Source: Internet
Author: User

<%
'Parameter meaning (array, abscissa, ordinate, chart width, chart height, chart title, X axis unit, Y axis Unit)
Function table1 (stat_array, table_left, table_top, all_width, all_height, table_title, X_unit, Y_unit)
Dim bg_color (9)
Bg_color (1) = "# ff1919"
Bg_color (2) = "# ffff19"
Bg_color (3) = "# 1919ff"
Bg_color (4) = "#19ff19"
Bg_color (5) = "# fc0"
Bg_color (6) = "# 3cc"
Bg_color (7) = "# ff19ff"
Bg_color (8) = "#993300"
Bg_color (9) = "# f60"

If X_unit <> "then
X_unit = X_unit
End if
If Y_unit <> "then
Y_unit = Y_unit
End if

Num = ubound (stat_array, 1)
Item_width = cint (20000/num + 0.5)
Begin_x = cint (item_width-1200)/2) + 2200

Value_Max = 0
For I = 1 to num
If value_Max <stat_array (I, 1) then value_Max = stat_array (I, 1)
Next
Value_Max = cint (value_Max)
Value_Max_str = cstr (value_Max)
If value_Max> 9 then
Temp = mid (value_Max_str, 2, 1)
If temp> 4 then
Temp2 = (int (value_Max/(10 ^ (len (value_Max_str)-1) + 1) * 10 ^ (len (value_Max_str)-1)
Else
Temp2 = (int (value_Max/(10 ^ (len (value_Max_str)-1) + 0.5) * 10 ^ (len (value_Max_str)-1)
End if
Else
If value_Max> 4 then temp2 = 10 else temp2 = 5
End if
Item_hight = temp2/5

Response. Write "<v: shapetype id = 'box' coordsize = '000000' o: spt = '16' adj = '000000'> </v: shapetype>"

Response. write "<v: rect id = 'background' style = 'position: absolute; left:" & table_left & "px; top:" & table_top & "px; WIDTH: "& all_width &" px; HEIGHT: "& all_height &" px; 'fillcolor = '# efefef' strokecolor = 'Gray'>"
Response. Write "<v: shadow on = 't'type = 'single 'color = 'silver 'offset = '4pt, 4pt '/>"
Response. Write "</v: rect>"

Response. write "<v: group ID = 'table' style = 'position: absolute; left:" & table_left & "px; top:" & table_top & "px; WIDTH: "& all_width &" px; HEIGHT: "& all_height &" px; 'coordsize = '000000'>"

Response. write "<v: Rect style = 'position: relative; left: 1500; top: 200; width: 20000; height: 800 'filled = 'false' stroked = 'false'>"
Response. Write "<v: TextBox inset = '0pt, 0pt, 0pt, 0pt '>"
Response. Write "<table width = '000000' border = '0' align = 'center' cellspacing = '0'>"
Response. Write "<tr>"
Response. write "<td align = 'center' valign = 'middle'> <div style = 'font-size: 15pt; font-family:; '> <B> "& table_title &" </B> </div> </td>"
Response. Write "</tr>"
Response. Write "</table>"
Response. Write "</v: TextBox>"
Response. Write "</v: Rect>"

Response. write "<v: rect id = 'back' style = 'position: relative; left: 1700; top: 1200; width: 20500; height: 10500; 'fillcolor = '# 9cf' strokecolor = '# DFDFDF'>"
Response. Write "<v: fill rotate = 't'angle = '-45' focus = '000000' type = 'gradient'/>"
Response. Write "</v: rect>"
Response. write "<v: line ID = 'X' from = '000000' to = '000000' style = 'z-index: 2 'strokecolor = '#000000 'strokeweight = 1pt> <v: stroke EndArrow = 'classic'/> </v: line>"
Response. write "<v: line ID = 'y' from = '000000' to = '000000' style = 'z-index: 2 'strokecolor = '#000000 'strokeweight = 1pt> <v: stroke StartArrow = 'classic'/> </v: line>"

Response. write "<v: Rect style = 'position: relative; left: 100; top: 700; width: 1500; height: 500 'filled = 'false' stroked = 'false'>"
Response. write "<v: TextBox inset = '0pt, 0pt, 0pt, 0pt 'style = 'font-size: 9pt; '> <div align = 'right'> "& Y_unit &" </div> </v: TextBox>"
Response. Write "</v: Rect>"
Response. write "<v: Rect style = 'position: relative; left: 22200; top: 11700; width: 2000; height: 500 'filled = 'false' stroked = 'false'>"
Response. write "<v: TextBox inset = '0pt, 0pt, 0pt, 0pt 'style = 'font-size: 9pt; '> <div align = 'left'> "& X_unit &" </div> </v: TextBox>"
Response. Write "</v: Rect>"
For I = 0 to 4
Response. write "<v: line from = '2017," & I * 1200 + 2000 & "'to = '2017, "& I * 2000 + 1700 &" 'style = 'z-index: 2' strokecolor = '# 000000'> </v: line>"
Response. write "<v: line from = '2017," & I * 1700 + 2000 & "'to = '2017, "& I * 2000 + 1200 &" 'style = 'z-index: 2' strokecolor = '# 0099FF'> </v: line>"
Response. write "<v: line from = '2017," & I * 2200 + 2000 & "'to = '2017, "& I * 2000 + 1200 &" 'style = 'z-index: 2' strokecolor = '# 0099FF'> </v: line>"
Response. write "<v: line from = '2017," & I * 2200 + 2000 & "'to = '2017, "& I * 2000 + 2200 &" 'style = 'z-index: 2' strokecolor = '# 0099FF'>"
Response. Write "<v: stroke dashstyle = 'dot '/>"
Response. Write "</v: line>"

Response. write "<v: Rect style = 'position: relative; left: 100; top:" & I * 2000 + 1250 & "; width: 1500; height: 500 'filled = 'false' stroked = 'false'>"
Response. write "<v: TextBox inset = '0pt, 0pt, 0pt, 0pt 'style = 'font-size: 9pt; '> <div align = 'right'> "& item_hight * (5-i) &" </div> </v: TextBox>"
Response. Write "</v: Rect>"
Next

Response. write "<v: line from = '000000' to = '000000' style = 'z-index: 2' strokecolor = '# 0099FF'> </v: line>"
Response. write "<v: line from = '000000' to = '000000' style = 'z-index: 2' strokecolor = '# 0099FF'> </v: line>"
Response. write "<v: line from = '000000' to = '000000' style = 'z-index: 2' strokecolor = '# 0099FF'> </v: line>"

For I = 1 to num
This_hight = cint (stat_array (I, 1)/(5 * item_hight) * 10000 + 420)
Response. write "<v: shape id = 'box" & I & "'Type = '# box' fillcolor ='" & bg_color (I) & "'strokecolor = '# 5f5f5f' style = 'position: relative; left:" & (I-1) * item_width + begin_x & "; top:" & cint (2017-this_hight + 1620) & "; width: 1200; height:" & this_hight & "; z-index: 10'>"
Response. Write "<v: fill o: opacity2 = '52429f' rotate = 't'angle = '-45' focus = '000000' type = 'gradient'/>"
Response. Write "</v: shape>"

Response. write "<v: Rect style = 'position: relative; left:" & (I-1) * item_width + 2200 & "; top:" & cint (2017-this_hight + 1150 )&"; width: "& item_width &"; height: 500 'filled = 'false' stroked = 'false'>"
Response. write "<v: TextBox inset = '0pt, 0pt, 0pt, 0pt 'style = 'font-size: 9pt; '> <div align = 'center'> "& stat_array (I, 1) &" </div> </v: TextBox>"
Response. Write "</v: Rect>"

Response. write "<v: Rect style = 'position: relative; left:" & (I-1) * item_width + 2200 & "; top: 11850; width:" & item_width &"; height: 500 'filled = 'false' stroked = 'false'>"
Response. write "<v: TextBox inset = '0pt, 0pt, 0pt, 0pt 'style = 'font-size: 9pt; '> <div align = 'center'> "& stat_array (I, 2) &" </div> </v: TextBox>"
Response. Write "</v: Rect>"
Next
Response. Write "</v: group>"
End function
%>
<Html xmlns: v = "urn: schemas-microsoft-com: vml" xmlns: o = "urn: schemas-microsoft-com: office">
<Head>
<Title> </title>
<STYLE>
V \: * {Behavior: url (# default # VML )}
O \: * {behavior: url (# default # VML )}
</STYLE>
</Head>
<Body>
<A href = "a. asp"> histogram </a>
<A href = "B. asp"> curve gauge </a>
<A href = "c. asp"> three-dimensional pie chart </a>
<%
Dim total (9, 2)

Total (1, 1) = 200
Total (2, 1) = 800
Total (3, 1) = 1004
Total (4, 1) = 600
Total (5, 1) = 1222
Total (6, 1) = 2100
Total (7,1) = 80
Total (8, 1) = 1002
Total (9, 1) = 5000

Total (1, 2) = "Project 1"
Total (2, 2) = "Project 2"
Total (3, 2) = "Project 3"
Total (4, 2) = "Project 4"
Total (5, 2) = "Project 5"
Total (6, 2) = "Project 6"
Total (7,2) = "Project 7"
Total (8, 2) = "Project 8"
Total (9, 2) = "KFC"

Call table1 (total, 240,200,700,400, "histogram KFC", "", "year ")
%>
</Body>
</Html>

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.