2016-08-25 26 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

希望它可以帮助别人的未来。