Click to See Complete Forum and Search --> : Dynamic Graphs
khaki
02-03-2003, 01:31 PM
I would like to display graphs on an ASP page which are populated from data in a DB.
In the past I used Crystal Reports for this (someone created the report, and I just put the necessary links/scripting into the page).
I no longer have access to Crystal Reports (or the person who created the reports!) so that pretty much puts me back at square 1.
So OK, square 1.
What options are available for creating quality and dynamic graphs (other than Crystal Reports)?
I'd like to be able to use different charts types as well (line, bar, combo, 2-axis, pie, etc), but the bottom-line is that whatever kind of chart it is, it needs to look good.
Someone out there must be working with charts. I'd appreciate any advice that you can give.
Thanks
k
(OH... not Flash. That's waaaay more complicated than what I am after. I've never used it and I don't think that I'm the Flash type)
Ribeyed
02-03-2003, 05:35 PM
hi,
i can help with this one, but sorry you will need to wait until i can write some code, thanks will try get it done next few days
Ribeyed
02-04-2003, 08:48 AM
hi,
try this following code. I have also included a screen shot of what this code with produce.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%
set discoveryDB = server.createobject ("adodb.connection")
discoveryDB.open "discovery"
set RSGraphData = discoverydb.Execute("SELECT OrderDate, SUM(Total) AS Sales " _
& "FROM tblOrders GROUP BY OrderDate ")
ReportTitle = "Historical Sales Report"
TopValue = RSGraphData("Sales")
%>
<FORM ACTION="./index.asp" METHOD=POST>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=640>
<TR VALIGN="top" ALIGN="left">
<TD WIDTH=75 HEIGHT =8><IMG SRC="./assets/images/dot_clear.gif" WIDTH =75 HEIGHT =1 BORDER=0></TD>
<TD WIDTH=506><IMG SRC="./assets/images/dot_clear.gif" WIDTH =506 HEIGHT =1 BORDER=0></TD>
<TD WIDTH=59><IMG SRC="./assets/images/dot_clear.gif" WIDTH =59 HEIGHT =1 BORDER=0></TD>
</TR>
<TR VALIGN="top" ALIGN="left">
<TD HEIGHT =59></TD>
<TD WIDTH=506>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 >
<%
Do Until RSGraphData.EOF
RowCounter = RowCounter + 1
If RowCounter Mod 2 = 0 then
TheColor = "#FFFFF1"
else
TheColor = "#FFE6E6"
end if
%>
<TR VALIGN="top" ALIGN="left">
<TD WIDTH=111 BGCOLOR="<% Response.Write TheColor %>">
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 WIDTH=111>
<TR>
<TD><P><FONT SIZE="-1"><% Response.Write RSGraphData("OrderDate") %></FONT></TD>
</TR>
</TABLE></TD>
<TD WIDTH=395 ALIGN="left" VALIGN="top" HEIGHT=19><IMG HEIGHT=15 WIDTH=<% Response.Write RSGraphData("Sales") / TopValue * 300 %> SRC="./assets/images/bluebar.gif" BORDER=0 ALT="<% Response.Write formatCurrency(RSGraphData("Sales")) %>" > <% Response.Write formatCurrency(RSGraphData("Sales")) %></TD>
</TR>
<%
RSGraphData.MoveNext
Loop
%>
</TABLE></TD>
<TD></TD>
</TR>
</TABLE>
</FORM>
</body>
</html>
Hope this helps
khaki
02-04-2003, 04:24 PM
Well guys...
You both put in a lot of effort and gave me some workable bar graphs.
So please don't take offense that they are not exactly what I'm looking for. Unfortunately I'm measuring them against Crystal Reports graphs - which is REALLY unfair, I know.
So unless there is another app out there which is similar to CR in making graphs, I may have to bite the bullet and add CR and a good reference manual to my birhday list.
Thank you SO MUCH for all of your work though. I REALLY do appreciate it. I owe ya one.
Thanks
k