views:

149

answers:

7

Hello. How could I make an image graph from values in a database? The idea came from "Steam", which uses a graph to show how many users are online. How could I do the same thing? It seems like the graph is one whole image; not made up of parts. Here's an image of the graph from Steam:
alt text

Thanks.

+3  A: 

Use this GD module from PHP. http://php.net/manual/en/book.image.php

Svisstack
+2  A: 

You will mainly need to keep a track of how many users were connected at each period of time. Drawing the graph is easy, they are some really neat library to help you with it. ;)

Savageman
+2  A: 

+1 for Svisstack's link. Here's another one (less supported, less documented, but more features): http://www.php.net/imagick

Felix
I know about ImageMagick being used for scaling images and doing other image processing operations. But how does it help with creating an image from raw data?
wallyk
Yes, it can be used to create images from scratch and draw on them.
Felix
+2  A: 

You want to use JPGraph, it is a very power PHP graphing library. http://www.aditus.nu/jpgraph/

webdestroya
+2  A: 

The easiest way is using the Google Chart API. You can generate a graph by simply creating a url with your values (basic example)

Joel L
A: 

I use FLOT with Jquery -> http://code.google.com/p/flot/

I find it easier to work with CSS than GD library to get the layout I want.

niggles
A: 

if you are the javascript lover use this, http://raphaeljs.com/

they keep updating and many advance function.

Nazmin