Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate dynamic graph from MySQL data

Tags:

php

graph

image

How can I generate a graph based on data inside my database? For example, I want to display the traffic of a website between a 90 day span, and a graph will display this, like a line graph. I don't like the PHP image and GD functions, they are really pixelated and are actually PHP pages acting like images. I'm not sure if this is how I've seen it done on other websites, but I would like a smooth image.

like image 979
David Avatar asked May 12 '26 12:05

David


1 Answers

Great question one awesome solution that i have done is to use: http://code.google.com/apis/chart/ The Google Chart has lots of great graphs etc.. you can use. What i did was look at the examples see how the data was formatted, then I wrote my query to match it.

like image 198
Jtello Avatar answered May 14 '26 03:05

Jtello