0
如何讓jqplot調整最小值和最大值以及範圍,就像它在初始圖上一樣? 現在它重新標記,但新數據從屏幕上消失。jqplot重繪和重新校準軸和範圍
<body>
<input type=button onClick=replot() value=replot><br>
<div id="chart1" style="height:400px;width:600px; "></div>
</body>
</html>
<script>
var plot1;
function replot(){
alert(plot1);
alert(plot1.data);
plot1.series[0].data=[[0,1],[0,2],[1,4]];
alert(plot1.data);
plot1.replot();
}
// Some simple loops to build up data arrays.
var cosPoints = [];
for (var i=0; i<2*Math.PI; i+=0.4){
cosPoints.push([i, Math.cos(i)]);
}
$(document).ready(function(){
plot1 = $.jqplot('chart1', [cosPoints], {
title: 'Google, Inc.'
});
});
不要忘記將你的答案標記爲已接受的答案! – AndyJ 2014-12-19 11:12:19