2016-08-25 101 views
1

我正在尋找一種方法來設置堆積條形圖中一組列的背景顏色。HighCharts backgroundcolumn的backgroundcolor

我們的x軸顯示了過去2年的所有月份,但我需要一種方式來將2015年的月份與2016年的月份進行可視化處理。我不想擁有第二個x軸,而是想要將前12個月的背景顏色設置爲特定顏色,並將剩餘的月份設置爲其他顏色。

所以在下面的圖片中,紅色條左邊的所有東西都應該有一個顏色。

enter image description here

由於提前,

雅尼克

回答

1

好吧,我其實已經知道x軸的plotbands財產,但我從來沒有得到它的工作,因爲我顯示字符串價值觀(Januari,二月等)。

什麼工作如下:

xAxis: { 
    plotBands:[{ 
     color: '#FCFFC5', 
     from: -1, // 0 isn't correctly filling up the most left column 
     to: 11.5 // 11 isn't correctly filling up the december column 
    }] 
} 

結果如下:

enter image description here

希望它可以幫助別人的未來。