$chart = new Highchart(Highchart::HIGHSTOCK);
$chart->chart->renderTo = "container";
$chart->chart->events->load = new HighchartJsExpr("function() {\n    var series = this.series[0];\n    setInterval(function() {\n        var x = (new Date()).getTime(), // current time\n        y = Math.round(Math.random() * 100);\n        series.addPoint([x, y], true, true);\n    }, 1000); }");
$chart->rangeSelector->buttons = array(array('type' => "minute", 'count' => 1, 'text' => "1M"), array('type' => "minute", 'count' => 5, 'text' => "5M"), array('type' => "all", 'text' => "All"));
$chart->rangeSelector->inputEnabled = false;
$chart->rangeSelector->selected = 0;
$chart->title->text = "Live random data";
$chart->exporting->enabled = false;
$chart->series[] = array('name' => "Random data", 'data' => new HighchartJsExpr("(function() {\n    var data = [], time = (new Date()).getTime(), i;\n\n    for( i = -999; i <= 0; i++) {\n        data.push([\n          time + i * 1000,\n          Math.round(Math.random() * 100)\n        ]);\n    }\n    return data;\n  })()"));
?>

<html>
    <head>
        <title>Dynamically updated data</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <?php 
$chart->printScripts();
?>
    </head>
    <body>
        <div id="container"></div>
        <script type="text/javascript">
        <?php 
$option = new HighchartOption();
$option->global->useUTC = false;
echo Highchart::setOptions($option);
echo $chart->render("chart");
?>
        </script>
    </body>
</html>