2013-12-19 12 views
0

我已經檢查了代碼中的昏迷,分號,並且都顯得很好。在Firefox和Chrome中它工作正常,但是在IE8中它提示我Highcharts.js中的無效參數行80指向:highcharts.js中的參數行80無效

if(!C.namespaces.hcv)C.namespaces.add("hcv","urn:schemas-microsoft-com:vml") 

這裏是我的代碼

var chart = new Highcharts.Chart({ 
     chart: { 
      renderTo: container[0], 
      type: 'column', 
      style: { 
       fontFamily: '"Arial", "Helvetica", "sans-serif"', 
       fontSize: '12px', 
       fontWeight: 'bold' 
      }, 
      spacingLeft: 0 

     }, 
     credits: { 
      enabled: false 
     }, 
     title: null, 
     yAxis: { 
     title: null, 
      lineWidth: 2, 
      lineColor: '#505050', 
      gridLineWidth: 0, 
      labels: { 
       step: 1, 
       y: 0, 
       style: { 
        fontFamily: '"Arial", "Helvetica", "sans-serif"', 
        fontSize: '11px', 
        fontWeight: 'normal' 
       } 
      }, 



      min: 0, 
      minRange:0.1 

     }, 
     xAxis: { 
      categories:cat, 
      labels: { 
       style: { 
        fontFamily: '"Arial", "Helvetica", "sans-serif"', 
        fontSize: '11px', 
        fontWeight: 'normal', 
        width: '90px' 
       } 
      }, 
      tickWidth: 0 
     }, 
     plotOptions: { 
      column: { 

       dataLabels: { 
        enabled: true, 
       formatter: function() { 


         var percent =0; 

         var catName =this.x; 

         if(catName.indexOf('TAM')>=0){ 
          percent = this.y ;    
          if (percent <= 50) { 
           return '<span style="color: #7b4000">' + percent + '</span>'; 
          } else { 
           return '<span style="color: #3a5305">' + percent + '</span>'; 
          } 

         } 

         else { 
          percent =Math.round(this.point.shareValue * 100)/100; 

          if (percent <= 50) { 
           return '<span style="color: #7b4000">' + percent + '%</span>'; 
          } else { 
           return '<span style="color: #3a5305">' + percent + '%</span>'; 
          } 
         } 
        }, 

        style: { 
         fontFamily: '"Arial", "Helvetica", "sans-serif"', 
         fontWeight: 'bold' 
        }, 
        zIndex: 11, 
        useHTML: true 
       }, 
       borderWidth: 0, 
       shadow: false 
      } 
     }, 
     series: [{ 
      data: data 
     }], 
     legend: { 
      enabled: false 
     }, 
     tooltip: { 
      enabled: false 
     } 
    }, function(chart) { 
     for (var i = 0; i < 5; ++i) { 
      chart.renderer.path(['M', 23, 160.5 - 28 * i, 'L', 34, 160.5 - 28 * i]).attr({ 
       'stroke-width': 1, 
       stroke: 'white', 
       'stroke-opacity': 0.7, 
       zIndex: 10 
      }).add(); 
      if ($.browser.msie && parseInt($.browser.version <= 8) && !CHART_CUT_LINE_FOR_IE) { 
       continue; 
      } 
      chart.renderer.path(['M', 30, 160.5 - 28 * i, 'L', 300, 160.5 - 28 * i]).attr({ 
       'stroke-width': 1, 
       stroke: 'white', 
       'stroke-opacity': 0.3, 
       zIndex: 10 
      }).add(); 
     } 
    }); 

任何想法?

謝謝。

+0

您沒有提供完整的代碼。使用圖表代碼,設置我的'categories'和'data',並且包括jquery 1.8.3('$ .browser.msie'從1.9.0開始不可用)我得到了沒有錯誤的圖表。最好在jsFiddle中準備例子。 –

+0

請提供完整的代碼 – SPandya

回答

0

我碰上了這個網址:Highcharts IE issues with jQuery ajax load。我評論了我的highcharts.js文件下面的代碼片段

,C.createStyleSheet().cssText="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } 

它的工作,現在它在IE中工作。

0

試圖改變這一行:

if ($.browser.msie && parseInt($.browser.version <= 8) && !CHART_CUT_LINE_FOR_IE) { 
      continue; 
     } 

到:

if ($.browser.msie && parseInt($.browser.version, 10) <= 8 && !CHART_CUT_LINE_FOR_IE) { 
      continue; 
     }