Jump to content

Graphs And Charts In Php


podarum

Recommended Posts

Hi, I'm trying to insert some graphs and charts from my SESSION data in my php pages.. and have no idea on how to start.. I read that I need a GD Library, but do I install it, where and how? to my root in the host???? Thanks.

Link to comment
Share on other sites

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...

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.

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?
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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...