好的,我有一个Highcharts图表,可以正确地显示来自数据库的数据; 但是一旦我放大,图表就会变空白?
这是图表的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
}]
});
});
我这里有什么做得不对吗?图表似乎一直显示为空白。:/