我用 HTML/PHP/Javascript 编写了一个网站,它必须每秒显示存储在 MySQL 数据库中的数据。它将其显示为图形(运行生成的 PNG 图像graph.php
)。
<!DOCTYPE html>
<html>
<title>Live Tracking Run'INSA</title>
<head>
<script type = "text/javascript">
function refresh() {
document.getElementById('graph').src = 'graph.php';
}
</script>
</head>
<p><h2>Visualisation des données</h2></p>
<body onLoad='setInterval(refresh, 1000);'>
<img id='graph'/>
</body>
</html>
visualiser.php
可以很好地显示图形,但graph.php
不会按预期更新最后一个。
PS:图表(使用 pChart 库制作)也显示了心率作为时间的函数。