<HTML> <HEAD> <TITLE>Histogram Demo</TITLE> </HEAD> <BODY> <% if Request("Content_Length")=0 then %> <FORM NAME=aForm ACTION=ASP7.ASP METHOD=POST> Input three numbers:<BR> <INPUT NAME=V1><BR> <INPUT NAME=V2><BR> <INPUT NAME=V3><BR> <INPUT TYPE=SUBMIT> </FORM> <% else %> <% total=0+request("V1")+request("V2")+request("V3") p1=(request("V1")/total)*100 p2=(request("V2")/total)*100 p3=(request("V3")/total)*100 %> <IMG SRC=hist.gif HEIGHT=25 WIDTH=<%=5*p1%>> V1: <%= CInt(p1) %>%<BR> <IMG SRC=hist.gif HEIGHT=25 WIDTH=<%=5*p2%>> V2: <%= CInt(p2) %>% <BR> <IMG SRC=hist.gif HEIGHT=25 WIDTH=<%=5*p3%>> V3: <%= CInt(p3) %>% <BR> <% end if %> </BODY> </HTML>

Programming for Active Server Pages (Web Techniques, Oct 1997)
Related Reading
More Insights
INFO-LINK
![]() |
To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy. |