2013-04-01 48 views
4

預先感謝您的時間和幫助。Highcharts.js - 軸的背景顏色只有

我使用highcharts,只需要設置x和y軸的背景色。見附表:

enter image description here

所以我需要的是設置在x軸的背景顏色從圖中的深灰色不同的(現在他們顯然是相同的)

有誰知道這是否可能,如果有的話,如何去做?我已經廣泛地通過了高空作業平臺API Highstock API,但找不到任何專門爲此而設的東西。

再次感謝您的時間和幫助!

豐富

回答

5

你嘗試:

rendered a rectangle and positioned it to the bottom of the graph. 
chart.renderer.rect(0/*position on X-axis*/, 275/*position on Y-axis*/, 680/*width*/ , 25/*height*/, 00) 
     .attr({ 
      'stroke-width': 0, 
      stroke: '#888888', 
      fill: '#888888', 
      zIndex: 3 
     }) 
     .add(); 

瞭解更多:highchart renderer

X-ASIS不具備的backgroundColor Set background color to HighChart xAxis labels

希望得到這個幫助。

+0

完美!非常感謝Anh! – pixelworlds