Jump to content

Graphs And Charts In Php


podarum
 Share

Recommended Posts

Step 1 is to figure out if it's already installed. Create a page with this:<?php phpinfo(); ?>and go to it. Look for a section called GD. If it's there, it's already installed. You can also use Imagemagick for some of the same things.

Link to comment
Share on other sites

Well, it doesn't matter where the data comes from, data is data. You can either find a PHP chart class or something to build the chart, or you can design it yourself and use the GD functions to draw the lines and shapes and things.

Link to comment
Share on other sites

  • 3 weeks later...

I just discovered this.http://code.google.com/apis/chart/Its Google's Chart API. Way easier to use than the Php GD library, and it looks a whole lot nicer. Its a fast way to do dynamic charting. Justsomeguy, are there any drawbacks to using something like this versus the GD library or Imagemagick?

Link to comment
Share on other sites

Google's API is just fine to use if you only want a pie chart. "Looks a whole lot nicer" only depends on how much time you're intending to spend working on your PHP GD application to make it look pretty.If there's anything that the Google API doesn't do that you require, then you can use one of PHP's image libraries.

Edited by Ingolme
Link to comment
Share on other sites

I made this using PHP GD, didn\'t take me too long.If you want to go about making your own, here is a list of all GD related functions.Its pretty simple actually, just make a background, add some lines and rectangles, add some text, and tada, you have a graph to display data.EDIT: I got this error when trying to display that image:

Sorry, dynamic pages in the tags are not allowed
Why do they block dynamic images/pages? Edited by CloneTrooper9494
Link to comment
Share on other sites

Just use .htaccess to redirect a .png (or whatever) to your .php page. They probably block them because validation is harder that way.

Link to comment
Share on other sites

Just use .htaccess to redirect a .png (or whatever) to your .php page. They probably block them because validation is harder that way.

Link to comment
Share on other sites

Google's API is just fine to use if you only want a pie chart. "Looks a whole lot nicer" only depends on how much time you're intending to spend working on your PHP GD application to make it look pretty.If there's anything that the Google API doesn't do that you require, then you can use one of PHP's image libraries.
well the google api has more than just pie charts. they have bar graphs both vertical and horizontal, easy ways to have legends, line graphs, etc. I was pretty excited when i saw this haha. A quick easy way to get a sweet looking chart on your application!
Link to comment
Share on other sites

ExtJS has some pretty cool charts that use the YUI Flash chart API:http://extjs.com/deploy/dev/examples/#sample-4I set this up for a friend this weekend, my first time playing around with the charting. It wasn't too bad:http://labean.org/test/
nice. those do look really good! whats the best way to learn ExtJS? I want to try it now after seeing all the cool things you've done. :)
Link to comment
Share on other sites

This is probably the best place to start:http://extjs.com/learn/Main_PageThere is a forum that gets a lot of use, but if you ask questions in the forum they generally expect that you've already gone through the API documentation and the examples. The tutorials section and community manual has a lot of good information in it, and the samples page has the source code for the samples they have there. It took me a few months to really become comfortable with it though, so unfortunately it's not a very quick process.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...