2013-04-01 47 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