How to use ASP to draw graph for example bar graph and so on?
Printable View
How to use ASP to draw graph for example bar graph and so on?
I don't know how to generate on-the-fly graphics with an ASP but one way you could do this is to use some dynamically generated tables. Below is an example of how this could be done:
A variation on this might populate the inner table with a number of small graphics if solid colors don't work for you. Dunno if this will help you.Code:<%@ Language=VBScript %>
<HTML>
<HEAD>
<TITLE>test.asp</TITLE>
</HEAD>
<BODY>
<TABLE BORDER="1" CELLPADDING="2" CELLSPACING="0">
<%
Dim intIndex
Dim intRandomValue
Dim strHTML
Randomize
For intIndex = 1 To 10
intRandomValue = Int(Rnd * 400) + 1
strHTML = strHTML & "<TR>"
strHTML = strHTML & "<TD>" & intRandomValue & "</TD>"
strHTML = strHTML & "<TD><TABLE BORDER=""0"" CELLPADDING=""0"" CELLSPACING=""0"">"
strHTML = strHTML & "<TR><TD BGCOLOR=""000080"" HEIGHT=""16"" WIDTH=""" & intRandomValue & """</TD></TR>"
strHTML = strHTML & "</TABLE></TD>"
strHTML = strHTML & "</TR>" & vbcrlf
Next
Response.Write strHTML
%>
</TABLE>
</BODY>
</HTML>
Good luck,
Paul
Actually what I want is to draw a pie to represent the percentage of my input.
How can I "link" my ASP to Excel or other software that enable me to draw a graph. Or how can I call Excel to draw a graph by using ASP.