Free Php Library to get Graphs i.e Pie Chart / Bar Chart via MySql -


i'm trying make pie chart data fetched database i.e mysql. checked few charts4php etc available freely ? can guide me ! thank

highcharts option you. can call php within javascript function:

<?php $query = "       select somevalue        table_name        order id desc limit 10"; $result = mysqli_query($conn, $query); //loop database results while ($row = mysqli_fetch_array($result)) { $data[] = $row['price']; } ?> <script> ...snip... //add join function separate each result comma data: [<?php echo join($data, ', '); ?>] </script> 

in example x-axis under categories: ''; , y-axis data: ''; here's fiddle, doesn't include php since it's not supported, should give idea how use highcharts.

http://jsfiddle.net/p5fcjv61/


Comments