<%@ LANGUAGE="VBSCRIPT" %> <% Option Explicit %> <% 'How many pixels high we want our bar graph Const graphHeight = 300 Const graphWidth = 450 Const barImage = "bluebar.gif" sub BarChart(data, labels, title, axislabel) 'Print heading Response.Write("" & chr(13)) Response.Write("" & chr(13)) Response.Write("") Dim widthpercent widthpercent = CInt((1 / (UBound(data) - LBound(data) + 1)) * 100) For i = LBound(data) to UBound(data) Response.Write(" " & chr(13)) Next Response.Write("") Response.Write("") 'Write footer Response.Write("" & chr(13)) for i = LBound(labels) to UBound(labels) Response.Write("" & chr(13)) next Response.Write("" & chr(13)) Response.Write("
") Response.Write("" & title & "
" & chr(13)) 'Find the highest value Dim hi hi = data(LBound(data)) Dim i for i = LBound(data) to UBound(data) if data(i) > hi then hi = data(i) next 'Print out the highest value at the top of the chart Response.Write(hi & "" & chr(13)) Response.Write(" " & chr(13)) Response.Write("
0
" & axislabel & "" & labels(i) & "
") end sub Dim dataArray(10) dataArray(0) = 8 dataArray(1) = 10 dataArray(2) = 8 dataArray(3) = 14 dataArray(4) = 6 dataArray(5) = 13 dataArray(6) = 7 dataArray(7) = 11 dataArray(8) = 8 dataArray(9) = 9 dataArray(10) = 11 Dim labelArray(10) labelArray(0) = "3/2" labelArray(1) = "3/3" labelArray(2) = "3/4" labelArray(3) = "3/5" labelArray(4) = "3/6" labelArray(5) = "3/7" labelArray(6) = "3/8" labelArray(7) = "3/9" labelArray(8) = "3/10" labelArray(9) = "3/11" labelArray(10) = "3/12" %>
<% BarChart dataArray,labelArray,"Telephone Sales","Date" %>