好吧,所以我有一個Highcharts圖表,可以正確顯示數據庫中的數據;但是當我放大時,圖表變爲空白?Highcharts圖表變爲空白zoomType:'x'區域範圍變焦?
以下是圖表HTML:
<div class="content" id="content"></div>
以下是圖表的Javascript代碼:
$(function() {
$('#content').highcharts({
chart: {
zoomType: 'x',
backgroundColor:'transparent'
},
credits: {
enabled: false
},
title: {
text: 'Players Online'
},
subtitle: {
text: document.ontouchstart === undefined ?
'Click and drag in the plot area to zoom in' :
'Drag your finger over the plot to zoom in'
},
xAxis: {
type: 'datetime',
maxZoom: 3600000, // 1 hour
title: {
text: null
}
},
yAxis: {
title: {
text: 'Players Online'
}
},
tooltip: {
enabled: false
},
legend: {
enabled: false
},
plotOptions: {
area: {
allowPointSelect: false,
fillColor: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1},
stops: [
[0, Highcharts.getOptions().colors[0]],
[1, Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0).get('rgba')]
]
},
lineWidth: 1,
marker: {
enabled: false
},
shadow: false,
states: {
hover: {
lineWidth: 1,
enabled: false
}
}
}
},
series: [{
type: 'area',
data: [<?php echo join($data, ',') ?>]
//This is displayed correctly in Javascript, so the issue isn't in my PHP
}]
});
});
我在這裏幹什麼一些愚蠢的事?似乎無法找到圖表空白的原因。 :/
可能重複http://stackoverflow.com/questions/11231398/highcharts-not-displaying-data-at-some-zoom-levels – svillamayor
你是否按x升序排列數據?你可以附加你的數據對象嗎? –
@ SebastianBochan我將圖表所在的網站鏈接在一起,因此您可以在其中查看數據。 – Simo389