var seriesData = null;
setTimeout(function(){
$(".chartDiv").animate({
top: "100px",
left: "100px",
width: "640px",
height: "360px"
});
}, 10000);
setInterval(function(){
console.dir($('#chartContainer').highcharts().series);
seriesData = [((Math.random() * 30) + 1), ((Math.random() * 30) + 1), ((Math.random() * 30) + 1), ((Math.random() * 30) + 1), ((Math.random() * 30) + 1), ((Math.random() * 30) + 1), ((Math.random() * 30) + 1), ((Math.random() * 30) + 1), ((Math.random() * 30) + 1), ((Math.random() * 30) + 1), ((Math.random() * 30) + 1), ((Math.random() * 30) + 1)];
var chart = $('#chartContainer').highcharts();
chart.series[0].setData(seriesData, false);
$('#chartContainer').highcharts().redraw();
}, 5000);
$(function() {
$('#chartContainer').highcharts({
title: {
text: 'Monthly Average Temperature',
x: -20 //center
},
subtitle: {
text: 'Source: WorldClimate.com',
x: -20
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
yAxis: {
title: {
text: 'Temperature (°C)'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
valueSuffix: '°C'
},
series: [{
name: 'Tokyo',
data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6]
}]
});
});
.chartDiv {
position: absolute;
height: 1280px;
width: 720px;
top:0px;
left:0px;
}
#chartContainer {
position:absolute;
height:100%;
width:100%;
}
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<div class="chartDiv">
<div id="chartContainer"></div>
</div>
這我試過了,但它不工作。圖表沒有任何反應。據我所知,如果沒有其他說明,則迴流應該是真實的,因此當母公司調整大小時調整大小。 – simtaxman
這裏是一個更新的小提琴在這: http://jsfiddle.net/devanshumadan/jqqz6vvm/ –
所以這會創建圖表後調整大小的權利?問題在於,如果我想以特定的時間間隔更改圖表中的信息,但是在另一個時間間隔中更改大小而不會相互干擾。如果在調整大小時創建圖表,我將看不到以特定間隔顯示的所有圖表。 – simtaxman