Graph In Php

softlogique
softlogique used Ask the Experts™
on
I have 5 locations in database table and percentage of these locations.
I want to pick locations on x-axis from database and percentage on y-axis.

From comparing these two locations on x-axis and 5 on y-axis ..i want to represent this data from database in graphically representation .

Please help me ...
i am using something like this script ..given below.
 

<script language=JavaScript>
var bg = new Graph(4);
bg.parent = document.getElementById('here');
bg.title = 'Graphical Representation For Each Hostel To Overall % Score';
bg.xCaption = 'Hostel Names';
bg.yCaption = '% For Hostels On<br>Daily Basis';

bg.xValues[0] = [<?php echo $J_L_Bridge;?>,'Journeys London Bridge'];

bg.xValues[1] = [<?php echo $J_K_Cross;?>,'Journeys Kings Cross'];
bg.xValues[2] = [<?php echo $J_Greenwich;?>,'Journeys Greenwich'];
bg.xValues[3] = [<?php echo $J_Brighton;?>,'Journeys Brighton'];
bg.xValues[4] = [<?php echo $J_Test;?>,'Journeys Test'];

bg.draw();
</script>
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
You're much better off using a Graph function ready built for PHP like GraPHPite

http://graphpite.sourceforge.net/
Top Expert 2010

Commented:

Commented:
I just wondering, have you tried using JPGraph before?

http://www.aditus.nu/jpgraph/index.php

Just let me know if you still prefer your previous method
I've also used JPGraph with good success.
Everything you need is already there.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial