SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist pompopom's Avatar
    Join Date
    Feb 2004
    Location
    Huldenberg (Belgium)
    Posts
    426
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    making a "pie"-diagram with php

    hi there,

    has anyone did this before:
    Next to the amounts of hits I'm receiving on a site for a camping area, I'm logging the countries from where I get visitors. This is off course now in numbers and I can easily calculate percentages/average each day and so on.

    but what I would like is a more visual "pie" chart/diagram as you can see with most netstat programs.

    can this be achieved with php or do I need to go other languages instead?

    greetz,
    Koen
    The Path of excess leeds to the tower of wisdom (W. Blake)

  2. #2
    Worship the Krome kromey's Avatar
    Join Date
    Sep 2006
    Location
    Fairbanks, AK
    Posts
    1,621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm sure someone will pop in and promote some great library or other, but I wrote my own code using only GD and basically followed the example provided in the documentation for imagefilledarc - the example is for a 3D-looking pie chart, and I basically copied that wholesale and with only a few minor tweaks I had created a great little script that I could call via an HTML img tag and pass in the necessary parameters (optional height and width, and a comma-delimited list of percentages to display) and display almost any pie chart I wanted to. Took me all of 45 minutes to perfect it, and that was while sitting in class listening to my CS professor drone on and on about Big-O and Little-O notations!
    PHP questions? RTFM
    MySQL questions? RTFM


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
  •