Results 1 to 11 of 11
  1. #1
    2 Star Lounger
    Join Date
    May 2003
    Location
    Perth, Western Australia, Australia
    Posts
    150
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Making an asp bar graph

    Hi,
    I was wondering if anyone knew how to go about creating a bar graph in asp, extracting the data from an access database?. I was searching the net for tutorials/code, but they all seem to take the data from the asp page itself or a text file.
    This would be a really cool feature to have, and it would be so appreciated if someone could show me how .
    Thanks

  2. #2
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    Faifax, Virginia, USA
    Posts
    542
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Making an asp bar graph

    try here http://www.pstruh.cz/tips/detpg_html...raph-chart.htm and other Google finds for "asp bar graph"

  3. #3
    2 Star Lounger
    Join Date
    May 2003
    Location
    Perth, Western Australia, Australia
    Posts
    150
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Making an asp bar graph

    Hi Peter,
    I did actually come across that page before, and I have done google searches. Just some of the code they provide I've found it a little bit of a challenge to use.
    However there is this amazing program called Swiff Chart Generator, that creates flash graphs. I downloaded it and reading up on it at the moment.

  4. #4
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Making an asp bar graph

    A lot of the things I have seen for creating graphs on-the-fly (from whatever data source) require the purchase and installation of a COM object in IIS. We have used Graphics Server at my workplace and it does a good job with producing graphics, but the load time is a little slow and the temp image file tends to get large. I have seen discussions on using Office's native Chart application but there are issues with configuring IIS to access this kind of functionality as there can be security risks and problems with load handeling in IIS as MS Chart is not, I believe, a multi-threading app.

    In short, from my experience, it is best to find, buy and install a COM application for IIS that allows ASP to hook into the extension and create your graphs.

    This site also has some further discussion of graphing in ASP: http://www.activeserverpages.ca/TUTO...dex.asp?c=e-co

  5. #5
    4 Star Lounger
    Join Date
    Aug 2002
    Location
    Dallas, Texas, USA
    Posts
    594
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Making an asp bar graph

    I looked at the link that Peter posted, and was able to make several graphs for a website log site. I'd be more then willing to show how I did it. (It pulls the data from an Access database). I have them setup to be pretty simple to add more charts to the system.

  6. #6
    2 Star Lounger
    Join Date
    May 2003
    Location
    Perth, Western Australia, Australia
    Posts
    150
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Making an asp bar graph

    Hi Drew
    That would be great, I also had a go at it, but just had too many problems getting it to work. If you've done a simple example, then that would be appreciated if you can show it to me.
    Thanks

  7. #7
    4 Star Lounger
    Join Date
    Aug 2002
    Location
    Dallas, Texas, USA
    Posts
    594
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Making an asp bar graph

    Okay, I am attaching a zipped file, that has 6 files.

    WebsiteLogs.mdb This is an Access 97 database, which holds 'compacted' web logs. (The 97 .mdb that holds the logs for our IIS webserver currently has 900,000+ records, and is 163 megabytes. I have a VB service that crunches the data into a format that is easier to run queries off of. The current crunched format is 11.1 megabytes, and even compacted, that's several megs. (Most of the data is numbers, which don't compact much).) The copy in this zip file only has one of the tables, and it has been stripped down to about 1 month's worth of data (2-16-03 to 3-21-03).

    DayHitCount.cls, a VB Class, which simply holds a HitCount and a Date value.

    DayHitCounts.cls a VB Class which retrieves and sorts the data from the database, and holds it within a collection of DayHitCount Classes.

    modDBConnect.bas, a plain module that connects to the .mdb, of course the path would need to be changed. This file, plus the two .cls files, should be put into a VB .dll (mine is called WebLog.dll)

    dailyhitsrange.asp: This is an ASP page that lets you select a data range to view the data for.

    dailyhitsdata.asp: This page shows up in an inline frame within dailyhitsrange.asp, and displays a graph based upon the data range selected. Please note that there is some FrontPage formatting on these pages....too lazy to remove it, sorry.

    Hope this helps.
    Attached Files Attached Files

  8. #8
    2 Star Lounger
    Join Date
    May 2003
    Location
    Perth, Western Australia, Australia
    Posts
    150
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Making an asp bar graph

    Thanks heaps Drew, I havnt actually tried it out yet but will do soon and let you know how it went, really really appreciated.

  9. #9
    4 Star Lounger
    Join Date
    Aug 2002
    Location
    Dallas, Texas, USA
    Posts
    594
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Making an asp bar graph

    No problem. Let me know how it goes! I am attaching a screen shot of one of my charts. Just a little tip. The example on the website won't print. I added a border thickness and border color property, so that it will print (boxes instead of filled in, but it's there....)
    Attached Images Attached Images

  10. #10
    2 Star Lounger
    Join Date
    May 2003
    Location
    Perth, Western Australia, Australia
    Posts
    150
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Making an asp bar graph

    Excellent, I take it the customisation part is quite basic atleast. By the way, check out this flash graph, I got it from
    Planet Source code, It will make your jaw literally drop. I played around with it 2 weeks ago, but I dont have the basic knowledge of flash to modify it., as in to retrieve the desired data from access.
    Buts its really cool, another milestone in the history of graphing [img]/forums/images/smilies/smile.gif[/img]
    Attached Files Attached Files

  11. #11
    4 Star Lounger
    Join Date
    Aug 2002
    Location
    Dallas, Texas, USA
    Posts
    594
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Making an asp bar graph

    Pretty slick graph. I see how to work it, you just change the data within graphdat.txt. However, I don't have Macro Media to edit the flash itself.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •