当我将它设置为缩放xy时,我遇到了HighCharts的问题。它变焦很好,但在其余部分,轴重置,但绘图区域保持不变。有时需要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' }
]
});
});
答案 0 :(得分:0)
这是暂时的问题,但在最新的主分支中它是固定的。
请参阅示例:http://jsfiddle.net/fZBjS/
<script src="http://github.highcharts.com/master/highcharts.js"></script>