Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Wanting to make a line graph

    Hi,

    I am wanting to make a line graph from search's for a search engine, So it'd show a amount of search's in days. They average about 20,000 search's per day. I am just wondering where i'd start? obviously the system would have to generate how many search's have gone on per day, But therefore onwards where would I go?

    Ross

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    With just PHP you'd use the GD library in order to generate an image with the line placements on it. You have to manually calculate the placement of all points on the image and simply draw a line between them. So you'll need to determine the max and min numbers available, the size of the image in use, and with that information you can calculate all the points to plot.

    I'm sure someone has likely written a plot/graph script in the past and has it available, so if you're in a time crunch you can probably find something if you try github.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,471
    Thanks
    0
    Thanked 634 Times in 624 Posts
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Tags for this Thread

    Posting Permissions

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