0

I want to make a dynamic line graph in php with mysql data. Please verify my Attached Image enter image description here

How to get this type of graph ?

Nisanth
  • 323
  • 8
  • 24

1 Answers1

0

Use this tutorial to plot graphs using Google visualisation.

https://developers.google.com/chart/interactive/docs/php_example

If you want to make it dynamic, you have to use AJAX to call a function in PHP which updates the graph every x seconds. To do that, update the function the following way

setInterval(function(){
$.ajax({url: "getData.php",
      dataType: "json",
      async: false


    }, dataType: "json"});
}, 1000);

This will repeat the call every 1 second. As the setIntervals second parameter is in Milliseconds.

crazyglasses
  • 530
  • 3
  • 10