SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Malaysia
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    OK.. now let's have PHP output SELECTs into GRAPH form!

    ok guys.. am back (sighs and groans of "oh noooo!")....

    question. can I grab stuff from my database.. like.. 4-5 diff. COUNT statements.. and then have PHP draw a column/line graph for me?

    hehe.. just a-wondering.. and as usual.. I don't want to work in a JAVA environment....

  2. #2
    You want what? By when?? Milamber's Avatar
    Join Date
    Jan 2001
    Location
    California
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, but you need a graphics library of some sort installed to be able to create graphics.
    -Jeff Minard | jrm.cc - Battlefield 2 Stats

  3. #3
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Malaysia
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Jesus H. CHRIST Milamber.. that was a fast reply!! do you guys live IN the forum's servers or something....

    anyway, mind providing me with more details on what you mentioned? graphics library?

  4. #4
    Node mutilating coot timnz's Avatar
    Join Date
    Feb 2001
    Location
    New Zealand
    Posts
    516
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    GD is one popular library:
    http://www.boutell.com/gd/

    You'll have to compile it into PHP to get it to work.

  5. #5
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Malaysia
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by timnz
    GD is one popular library:
    http://www.boutell.com/gd/

    You'll have to compile it into PHP to get it to work.
    I'm getting a "connection refused" to that site Tim.. but thanks.. will try later!

  6. #6
    Node mutilating coot timnz's Avatar
    Join Date
    Feb 2001
    Location
    New Zealand
    Posts
    516
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You sure, cos I just tried it again, worked for me fine

    The direct link to the distribution:
    http://www.boutell.com/gd/http/gd-1.8.4.tar.gz

  7. #7
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Malaysia
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yep.. i can go in now! OK.. since I'm running Apache on Windows 2K Pro, I go for the .zip file, not the UNIX one, right?

    Will get back to you if I have any problems... thanks!

  8. #8
    Node mutilating coot timnz's Avatar
    Join Date
    Feb 2001
    Location
    New Zealand
    Posts
    516
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well the two links are to the same file when I looked at it, or it could just be my eyes playing up. But it does seem strange, maybe the zip one is temporarily unavailable.

  9. #9
    SitePoint Columnist Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,066
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you're running on win2k you'll have trouble finding an image library you can use - in my experience they tend to be all aimed at linux/unix users. you could probably get it working with a lot of research and maybe some liberal applications of a Visual C++ compiler but I don't think it'll be easy...

    An easier alternative would be to get the PHP to generate HTML that draws a bar graph, for example with images where the width and height attributes are dynamically generated by the PHP.

  10. #10
    You want what? By when?? Milamber's Avatar
    Join Date
    Jan 2001
    Location
    California
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Skunk
    If you're running on win2k you'll have trouble finding an image library you can use - in my experience they tend to be all aimed at linux/unix users. you could probably get it working with a lot of research and maybe some liberal applications of a Visual C++ compiler but I don't think it'll be easy...

    An easier alternative would be to get the PHP to generate HTML that draws a bar graph, for example with images where the width and height attributes are dynamically generated by the PHP.

    Very good point. More specifically make a few images like this:


    red.gif = 1 x 1 pixel gif of red
    blue.gif = 1 x 1 pixel gif of blue
    green.gif = 1 x 1 pixel gif of green

    etc etc, then just change the height and width of those pictures. They'll load very fast and you'll get the nice graphs.


    HOWEVER, you'll only really be able to do bar charts....to do something like a pie chart you would actually need the graphics libraries.

    Have fun!
    ( and no, i don't live here! I was just on last night. )
    -Jeff Minard | jrm.cc - Battlefield 2 Stats

  11. #11
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Malaysia
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by timnz
    You sure, cos I just tried it again, worked for me fine

    The direct link to the distribution:
    http://www.boutell.com/gd/http/gd-1.8.4.tar.gz
    yeah.. they both lead to the same .tar.gz file.. prolly meant for linux or unix... sigh.

    nvm.. thanks for all the input.. will study them first before i decide...


Bookmarks

Posting Permissions

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