Forum Moderators: coopster

Message Too Old, No Replies

can we print out a bar chart by using PHP?

         

fukchai2000

9:41 am on Apr 7, 2005 (gmt 0)

10+ Year Member



hi guys,

I have an example:
I retrieve a some data from DB (just call it DBIncome) and i show it on the web pages in a table form.......is there any command in PHP that will allow us to directly print out this details to the printers?

another thing is: instead of a table....can we show it in a bar chart on the webpage? is there any command for it? (pie chart also ok).....

DBIncome could be just a simple DB that show Income each year....and i would like to show it on bar chart base on the year....can somebody help me out plzz....

Thanks

dmorison

9:53 am on Apr 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There is nothing specific to PHP (that I'm aware of) that is designed specifically for creating charts, but there are a few ways of going about it, besides purchasing a library.

You could create charts using the image functions:

[php.net...]

Alternatively, you can create a simple bar chart using nothing more than a few single pixel images of different colors and some plain ol' HTML. Use a table to align the images, and stretch them to the lengths required for each bar (which you can calclulate in your script) using the width='' attribute.