我有一个简单的条形图,在IE8下无法正确呈现(列不可见)。它可以使用firefox和IE 9 +正确显示。
我正在使用jQuery 1.8.3和highcharts 3.0.3。
我在代码示例中保留数据,因为绘制的列数对于重现问题非常重要。如果我删除一个系列,图表在IE8中正确呈现。
以下是代码:
$(function () {
$(document).ready(function() {
var barOptions = {
chart: {
renderTo: 'container',
width:450,
height:350,
type: 'column'
},
xAxis: {
categories: [0,1,2,3,4,5,6,7,8,9,10]
},
series: [{
name: 'NC',
data: [7057, 6858, 6643, 6570, 6115, 107, 31, 635, 203, 2, 2]
}, {
name: 'OK',
data: [54047, 52484, 50591, 49479, 46677, 33, 156, 947, 408, 6, 2]
}, {
name: 'KO',
data: [11388, 11115, 10742, 10757, 10290, 973, 914, 4054, 732, 34, 2]
}, {
name: 'VALID',
data: [8836, 8509, 8255, 7760, 7621, 973, 914, 4054, 732, 34, 2]
}, {
name: 'CHECK',
data: [115, 162, 150, 187, 172, 973, 914, 4054, 732, 34, 2]
}, {
name: 'COR',
data: [12566, 12116, 11446, 10749, 10439, 973, 914, 4054, 732, 34, 2]
}]
};
barChart = new Highcharts.Chart(barOptions);
});
});
有关如何解决此问题的任何想法?
答案 0 :(得分:1)
看起来像bug,向我们的开发人员报告:https://github.com/highslide-software/highcharts.com/issues/2091
答案 1 :(得分:1)
正如其他人所说,这看起来像是Highcharts中的一个错误。解决方法是在呈现图表后立即以编程方式隐藏和显示其中一个系列。
JSFiddle here。在IE8 here中尝试。
$(function () {
var barOptions = {
chart: {
renderTo: 'container',
width: 450,
height: 350,
type: 'column'
},
xAxis: {
categories: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
},
series: [{
name: 'NC',
data: [7057, 6858, 6643, 6570, 6115, 107, 31, 635, 203, 2, 2]
}, {
name: 'OK',
data: [54047, 52484, 50591, 49479, 46677, 33, 156, 947, 408, 6, 2]
}, {
name: 'KO',
data: [11388, 11115, 10742, 10757, 10290, 973, 914, 4054, 732, 34, 2]
}, {
name: 'VALID',
data: [8836, 8509, 8255, 7760, 7621, 973, 914, 4054, 732, 34, 2]
}, {
name: 'CHECK',
data: [115, 162, 150, 187, 172, 973, 914, 4054, 732, 34, 2]
}, {
name: 'COR',
data: [12566, 12116, 11446, 10749, 10439, 973, 914, 4054, 732, 34, 2]
}]
};
barChart = new Highcharts.Chart(barOptions);
barChart.series[0].hide();
barChart.series[0].show();
});