2014-01-16 67 views
1

我已經寫了幾十個這些圖表,並從未有過這個問題。我的y軸標籤沒有顯示在這個特定的圖表中:Highcharts:y軸標籤丟失

$(function() { 
$('#container').highcharts({ 
    chart: { 
     alignTicks: false, 
     animation: { 
      animation: false 
     }, 
     height: 180, 
     reflow: true, 
     width: 425, 
     zoomType: 'x' 
    }, 
    credits: { 
     enabled: false 
    }, 
    legend: { 
     enabled: false, 
     layout: 'horizontal' 
    }, 
    plotOptions: { 
     line: { 
      animation: false, 
      marker: { 
       radius: 0 
      }, 
      stickyTracking: false, 
      turboThreshold: 5000000, 
      zIndex: 1 
     }, 
     spline: { 
      animation: false, 
      marker: { 
       radius: 0 
      }, 
      turboThreshold: 5000 
     } 
    }, 
    title: { 
     text: '' 
    }, 
    tooltip: { 
     backgroundColor: '#303030', 
     borderColor: 'white', 
     borderRadius: 0, 
     borderWidth: 1, 
     style: { 
      font: '20pt [FontFamily: Name=Microsoft Sans Serif]', 
      padding: '10px', 
      color: 'white' 
     }, 
     valueDecimals: 0, 
     valueSuffix: 'F' 
    }, 
    xAxis: { 
     categories: ['Wed', 'Thu', 'Fri', 'Sat', 'Sun', 'Mon', 'Tue'], 
     lineColor: 'black', 
     lineWidth: 2 
    }, 
    yAxis: { 
     endOnTick: false, 
     gridLineWidth: 0, 
     lineWidth: 2, 
     maxPadding: 0, 
     minPadding: 0, 
     startOnTick: false, 
     id: 'ForecastData', 
     lineColor: 'black', 
     linkedTo: 0, 
     offset: 0, 
     title: { 
      text: '' 
     }, 
     type: "linear" 
    }, 
    exporting: { 
     buttons: { 
      exportButton: { 
       enabled: false 
      }, 
      printButton: { 
       enabled: false 
      } 
     }, 
     enabled: false 
    }, 
    series: [{ 
     data: [33, 31, 35, 33, 36, 37, 36], 
     labelText: 'Daily Min Temperature', 
     name: 'Daily Min Temperature', 
     type: 'spline', 
     color: '#2177E0' 
    }] 

}); 

});

http://jsfiddle.net/5QBzv/

我似乎無法找出什麼我失蹤。有任何想法嗎?

謝謝!

+1

yAxis.linkedTo似乎會導致問題,不知道爲什麼,但似乎是一個錯誤。 –

+0

好看的弗洛裏安!謝謝! –

回答

1

嘗試用這種

xAxis: { 
     categories: ['Wed', 'Thu', 'Fri', 'Sat', 'Sun', 'Mon', 'Tue'], 
     lineColor: 'black', 
     lineWidth: 2 
      }, 
yAxis: { 
     title: { 
        text: 'DATA' 
       }, 
       lineColor: 'black', 
       lineWidth: 2 
       categories: ['1', '2', '3', '4', '5', '6', '7'], 
      }, 

更換您的X和Y軸或者從你的代碼中刪除linkedTo。