Forum Moderators: coopster

Message Too Old, No Replies

How to create Graphs in Php?

         

TravelSite

10:30 am on Apr 26, 2006 (gmt 0)

10+ Year Member



I need to create some graphs (pie charts, bar graphs etc) in PHP 5.0.5 to display results from a medical questionnaire so that results are easy to comprehend.

I have some limited php and mysql knowledge and I'm using PHP 5.0.5 on a shared server.

I'd be grateful if someone could advise me on a way to create graphs from php variables. Ideally I need something that is quick to implement, easy for me to understand, doesn't involve installing anything on the server (I only have ftp access to the websites folder) and - as the site is a freebie I'm doing for a student - is preferably free/open source.

I've spent some time on this but don't seem to be getting anywhere.

Thanks

4ior

10:48 am on Apr 26, 2006 (gmt 0)

10+ Year Member



you can do this with a table:

echo "<table><tr><td height='{$line1}' bgcolor='red' width='15'>{$line1}</td></tr></table>";

hakre

10:57 am on Apr 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



or with divs and css:


<div style="position: relative; z-index:99; background-color:red; height:400px; width:50px;left: 0px; top:0px;">400</div>

(or similar)

remember to calculate the position/size (top, left, width, height) and background value wise. also, the innerText of the Div should be exchanged to whatever you like and you might need another text-color then default for your background (ie in css: color:white;).