<%call chart("Apple,Pear,Mango,Bannana,Other","1,3,6,7,20",5)%>
<%sub chart(arrNames,arrValues,records)
const x = 0
const y = 1
arrValues=cArr(arrValues)
arrNames=cArr(arrNames)
For i=0 To UBound(arrValues)
intNumberSold = cint(arrValues(i))
If intNumberSold > max Then
max = intNumberSold
End If
Next
%>
<table cellspacing="0">
<tr>
<td>
<div style="border-left:1px solid #000000;margin:10px;">
<%
if ubound(arrValues) >= records-1 then
records = records
else
records = ubound(arrValues)
end if
for n=0 to records-1
height = (round(cint(arrValues(n))/max *100))%>
<img src="graph/blank.gif" width="8" style="border-bottom:1px solid #000000;margin-left:-4px;" /><img src="graph/<%=n%>.gif" height="<%=height%>" width="8" style="border-bottom:1px solid #000000;" alt="<%=arrValues(n)%>" />
<%next%>
<img src="graph/blank.gif" width="8" style="border-bottom:1px solid #000000;margin-left:-4px;" />
</div>
</td>
<td>
<div style="padding-left:20px;">
<%for n=0 to records-1 %>
<img src="graph/<%=n%>.gif" height="8" width="8" alt="<%=arrValues(n)%>" /> <%=arrNames(n)%><br />
<%next%>
</div>
</td>
</tr>
</table>
<%end sub%>
<%
function cArr(str)
if not isArray(str) then
cArr = split(str, ",")
else
cArr = str
end if
end function
%>