Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 2nd, 2003, 12:13 AM
Authorized User
 
Join Date: Jun 2003
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Graphs

Hi, all:

I need to do some statistics with data in SQL SERVER DB. Basically, we need to generate some graphs, eg. bar, pie and line, etc. How can I create these graphs and display them in my WebForm? Please help. Thanks in advance.
__________________
Jie
 
Old July 2nd, 2003, 12:19 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

Dear friend:
make ur reports & graphs in Crystal Report & then add them in ur WebForm. ASPX file works fine with Crystal Report.

Always:),
Hovik Melkomian.
 
Old July 2nd, 2003, 12:31 AM
Authorized User
 
Join Date: Jun 2003
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for help.
Always :)
 
Old July 4th, 2003, 02:48 PM
Authorized User
 
Join Date: Jun 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You could also try using tables in html. I have found it very useful for simple bar charts.

Response.Write("<table>")
Do While DataReader.Read() ...
If DataReader("Percentage") < 10 Then
  strColor = "Red"
Else
  strColor = "Green"
End If
Response.Write("<tr><td>" & DataReader("Profit") & "</td><td width='100px'><img style='background-color:" & strColor & ";' src='pixel.gif' height='20px' width='" & DataReader("Percentage") & "px'></td>")
Loop
Response.Write("</table>")

The pixel.gif is a single pixel transparent gif. That way you can choose the colour for the bar. The above should give you the concept.

Regards

Skin
 
Old August 1st, 2003, 06:23 PM
Authorized User
 
Join Date: Jul 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to merediths
Default


Using HTML tables to simulate a graph would probably be the easiest solution, however if you nee more flexibility you can always create an Image object, use draw your graph on it, and use it's Save method specifiy an ImageFormat that is renderable by the browser (png probably would be good). You could actually have the <img src='graphname?args=arg'> in you webpage and then a seperate IHttpServer object that generates the graph and returns a stream..

Regards,
Meredith Shaebanyan






Similar Threads
Thread Thread Starter Forum Replies Last Post
Access and Graphs mat41 Access 1 December 8th, 2008 12:15 AM
Graphs in Forms Bob Gambles VB How-To 1 July 12th, 2005 01:49 PM
Line graphs goldablasha C# 0 April 25th, 2005 01:31 AM
line graphs goldablasha C# 1 April 6th, 2005 02:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.