我将HighCharts设置为放大xy时遇到问题。它可以很好地缩放,但在其余位置上,轴会重置,但绘图区域保持不变。有时需要2或3次才能中断,但一旦中断,它就保持中断。我的代码如下:
$(function () {
$('#container').highcharts({
chart: {
plotBorderWidth: 1,
spacingTop: 0,
spacingBottom: 0,
marginRight: 15,
zoomType: 'xy'
},
credits: {
enabled: false
},
title: "Test",
xAxis: {
title: {
text: "Year"
},
allowDecimals: false
},
yAxis: {
title: {
text: ''
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}],
labels: {
format: '${value:,.0f}',
minPadding: 1000
}
},
tooltip: {
useHTML: true,
headerFormat: '<bold>{series.name}</bold><table>',
pointFormat: '<tr><td style="color:#000000">Year {point.x} : ${point.y:,.0f}</td></tr>',
footerFormat: '</table>'
},
series: [
{ data: [[1, 805.593193551804], [2, 805.593193551804], [3, 805.593193551804], [4, 805.593193551804], [5, 805.593193551804], [6, 805.593193551804], [7, 805.593193551804], [8, 805.593193551804], [9, 805.593193551804], [10, 805.593193551804], [11, 805.593193551804], [12, 805.593193551804]], name: 'Before', color: '#EDF2DB', type: 'area' },
{ data: [[1, 805.593193551804], [2, 805.593193551804], [3, 805.593193551804], [4, 805.593193551804], [5, 805.593193551804], [6, 805.593193551804], [7, 805.593193551804], [8, 805.593193551804], [9, 805.593193551804], [10, 805.593193551804], [11, 836.4400689934657], [12, 867.8232333655329]], name: 'After', color: '#FF6600', type: 'column' }
]
});
});
这是暂时的问题,但在最新的master分支中已修复。
参见示例:http : //jsfiddle.net/fZBjS/
<script src="http://github.highcharts.com/master/highcharts.js"></script>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句