I am working on a web app and have no idea on how to properly do this, I am already using highstock for static charts, I retrieve temperatures from a Mysql database, and using a PHP class I myself designed I send the data through the use of json to javascript. I know what I trying to do it's possible, there's a jsfiddle example (http://jsfiddle.net/ovhb3jp1/) in highcharts webpage but it graphs only random js generated data.
My guess is I have to make a js script that constantly retrieves the temperatures from a PHP script and sends it to the highstock script that graphs, is that correct? how would i write such a script? I know a lot of PHP and Mysql, but my knowledge of js is pretty vague, so any help would be apreciated.
This is my existing js script
<script>
$(function () {
$('#container').highcharts('StockChart', <?php echo $chart; ?>);
});
</script>
This is the part of the class that generates the json for the $chart variable
function __toString(){
$this->datos();
return json_encode($this->hs);
}
The hs attribute of the class is an array loaded with the parameters of the highstock api, that through the above PHP code is converted into json and put into the above js script.
Thanks!