Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Graphs & Pie Charts in a web application

Status
Not open for further replies.

Custom24

Programmer
Nov 27, 2001
591
GB
Hello!

I'm going to have some reports in my web application which will produce something like this from a db

Month Entries
--------------------
Jan 100
Feb 200
Mar 400
Apr 300
etc

Presenting this to the user as a table is obviously not a problem - anyone have any ideas on how I could present them a pie chart or something?

Thanks
Mark
 
I have done something like this to display summary website statistics as a tables and a bar graph.

I used ASP to take the data from the database. This data was entered into the table as usual but the values were also used to determine the height of the bars in the graph.

The bars were simply a 1px x 1px gif that were stretched to a fixed width of about 15px and the height was the value from the database multiplied by a scaling factor to keep it to a sensible size.

The bargraph was built within a HTML table and was a lot simpler to do than I thought it would be.

Need any help then let me know
Tony
reddot.gif WIDTH=500 HEIGHT=2 VSPACE=3

 
Thanks Tony

Actually I think I've figured it out. I'll just build a dll in (VB6 or VB.net) which uses Microsoft Excel. In the excel object model, you can do this

Chart1.Export "C:\test.gif", "gif", False

Which exactly suits my needs

Thanks again

Mark

 
I am looking into making a chart with flash, dynamicly ofcourse which should be pretty interesting, + flexable.
 
I've been looking for a good way to do something like this with a line graph...anyone point me in the right direction?
thanks
mark "Where's the Ka-Boom? There's supposed to be an Earth-shattering Ka-Boom!"
Marvin the Martian
 
Rather than using the entire overhead of Excel, copy and register msowc.dll somewhere IIS/PWS can use it, and then you can do something like:

---MSOWCChart.asp---
<%@ language=&quot;vbscript&quot; %>
<html>
<body>
<%
dim fso
set fso = server.CreateObject(&quot;Scripting.FileSystemObject&quot;)
Dim oChart, c, Categories(5), Vals(5), i, sCaption, nData, nOrg
nData = 25
if len(nData) = 0 then nData = 5
randomize
for i = 1 to 5
Categories(i) = &quot;Machine&quot; & CStr(i)
Vals(i) = nData * Rnd(100)
next
Set oChart = Server.CreateObject(&quot;OWC.Chart&quot;)
Set c = oChart.Constants
oChart.Border.Color = c.chColorNone
nOrg = nData/5
sCaption = &quot;Current Utilizations for Org &quot;
sCaption = sCaption & CStr(nOrg)
oChart.Charts.Add
oChart.Charts(0).Type = oChart.Constants.chChartTypeColumnClustered
oChart.Charts(0).Type = 3
oChart.Charts(0).SeriesCollection.Add
oChart.Charts(0).SeriesCollection(0).Caption = sCaption
oChart.Charts(0).SeriesCollection(0).SetData c.chDimCategories, c.chDataLiteral, Categories
oChart.Charts(0).SeriesCollection(0).SetData c.chDimValues, c.chDataLiteral, Vals
oChart.Charts(0).HasLegend = True
oChart.Charts(0).HasTitle = True
sFname = &quot;graph.gif&quot;
oChart.ExportPicture server.MapPath(sFname), &quot;gif&quot;, 600, 512
Response.Write &quot;<img src='&quot; & sFname & &quot;'>&quot;
set oChart=nothing
%>

</body>
</html> codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
You're not a complete programmer unless you know how to guess.
I hope I never consider myself an 'expert'.
<insert witticism here>
 
Codestorm - where does msowc.dll come from? I've looked it up in MSDN but it does not seems to be available for download.

Also - I've gone off the excel idea anyway since I discovered crystal reports. I'm actually using asp.net, so I don't know if you can use these in a web app with classic asp....

Mark
 
msowc.dll is probably part of Excel - I copied it from my computer with Office installed, to the server computer. codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
You're not a complete programmer unless you know how to guess.
I hope I never consider myself an 'expert'.
<insert witticism here>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top