PDA

Click to See Complete Forum and Search --> : How to use ASP to draw graph?


lypor
Nov 16th, 2000, 05:08 AM
How to use ASP to draw graph for example bar graph and so on?

Nov 16th, 2000, 08:49 AM
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:


<%@ 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>


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.

Good luck,
Paul

lypor
Nov 21st, 2000, 05:35 AM
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.