2013-08-01 84 views
2

我有一個簡單的條形圖,它在IE8下無法正確呈現(列不可見)。它確實顯示與Firefox和IE 9 +。HighCharts - 條形圖在IE8中無法正確顯示

我使用jQuery 1.8.3和highcharts 3.0.3。

我保留代碼示例中的數據,因爲繪製的列數對於重現問題很重要。如果我刪除了一個serie,該圖在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); 
    }); 
}); 

關於如何解決此問題的任何想法?

回答

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(); 
}); 
+1

謝謝隱藏和顯示一個系列解決問題! – piravel