Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 26th, 2004, 06:30 AM
Authorized User
 
Join Date: Nov 2003
Location: Darwen, , United Kingdom.
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default graph

Having experimented with one component for drawing a line graph (see my earlier thread) ive been unable to get it to work the way that i want it to. Can anyone give me any advice on the best way to draw a line graph using asp.

The information is stored in an access database, with the y axis having a numerical value and the x axis a date value. ie test on 19/07/04 value is 4 etc.


Any help is greatly appreciated

Paul

Reply With Quote
  #2 (permalink)  
Old July 26th, 2004, 08:09 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Cochin, Kerala, India.
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

I suppose your problem is to give a date type value as the Y-Axis scale. Not every chart tools will permit a non-numeric value at the axis.

You can try showing only the date part of the date value as the Y Axis scale.

BTW, which is the component you are using ? The one I usually use is Chart director from http://www.advsofteng.com

Could you please explain the nature of the graph so I may able to help you further.
Reply With Quote
  #3 (permalink)  
Old July 26th, 2004, 08:18 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Cochin, Kerala, India.
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

I have just confirmed that ChartDirector can accept only days as the X / Y axis values and use a lable for each date. This means you can use day part of the date as the Y Axis value and then each such day value may be given a corresponding label whose text is the complete date.

For e.g. Suppose you are plotting daily sales variations from 1st of month to 31st of month, you can have 31 equally spaced co-ordinates at X-Axis. They corresponds to one date each. The val;ue of these co-ordinates will be from 1 to 31. Then at each of these points you can specify the label as 1st Jul 04, 2nd Jul04, etc. etc.

This must be possible in your component also.
Reply With Quote
  #4 (permalink)  
Old July 26th, 2004, 09:02 AM
Authorized User
 
Join Date: Nov 2003
Location: Darwen, , United Kingdom.
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The components is called csGraph. It may work in the same way as the one you use. How would the day number work, if for example the values spanned across several months, for example test data for two months with one test every single day? as i presume the day number after 31 would revert back to one?

thanks for all of your help

Reply With Quote
  #5 (permalink)  
Old July 26th, 2004, 09:51 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Cochin, Kerala, India.
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

If the data is spanned across more than one month (or year), you can create the value for a date as below.

iDatePart=day(datevalue)
iMonthPart=month(datevalue)
iYearPart=Year(datevalue)

lYValue=10000 * iYearPart + 100* iMonthPart + iDatePart

The max value of lYValue will be 99991231 which is very well below the maximum integer that can be handled by ASP.

You can use lYValue as the Y Cordinate value and give cdate(datevalue) as the lable part.

You can decide the max of such a value and the minimum of it (corresponding to the last date and first date). Then you can decide the scale to be used.

It is ofcourse not possible to show all the dates over past 10 years in a single graph. You may need to filter data and show results in more than one graph (perhaps one graph per year or so). But this is a design issue and need to be talked with your client.
Reply With Quote
  #6 (permalink)  
Old July 26th, 2004, 10:06 AM
Authorized User
 
Join Date: Nov 2003
Location: Darwen, , United Kingdom.
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey thats great!, Many many thanks, thankfully i dont think the client will need ten years worth of data ( i hope!)

thanks again
Paul

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
TO draw a graph shravanmv Visual Basic 2008 Essentials 0 May 12th, 2008 11:53 PM
Graph Problems ryan_goal C++ Programming 0 October 7th, 2006 03:08 AM
Graph in asp mateenmohd Classic ASP Basics 0 June 2nd, 2006 11:05 AM
UPDATE: Can't see my graph inge_03 Crystal Reports 0 March 20th, 2006 11:44 AM
graph pab006 Classic ASP Basics 1 April 30th, 2004 10:08 PM



All times are GMT -4. The time now is 01:03 PM.


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