我创建了一个图表,我想实时更新,这就是为什么我使用ajax。我的问题是,如何显示ajax响应?以下是我的图表示例脚本。请帮帮我。非常感谢。如何显示ajax响应
Chart.php -
$(document).ready(function() {
Highcharts.chart('container', {
chart: {
type: 'bar'
},
title: {
text: "TITLE"
},
series: [{
name: 'Present',
data: [*//must display the ajax response here//*]
}]
});
});
ajax.php
<script>
function fanc_no(){
$.ajax({
url: "test.php",
success: function(result){
$("#container").html(result);
}
});
}
window.setInterval(function(){
func_no();
}, 1000);
</script>
[使用Ajax将数据加载到Highcharts中]可能的副本(https://stackoverflow.com/questions/12223972/load-data-into-highcharts-with-ajax) –