Highstock远程覆盖

时间:2014-07-28 13:20:31

标签: highcharts highstock

我有一个Highstock图表,我想在其中添加"时区"作为叠加。

默认图表: enter image description here

预期: enter image description here

每个区域都有一个名称,一个开始和结束时间戳,一个背景颜色(这里有alpha)和基本标签属性。

是否可以使用当前的API?

我虽然有两种方法:

  • 使用绘制API(看起来很难知道区域是否可见,从时间戳中找到pos等)
  • 伪造多个区域图表相互重叠的区域

1 个答案:

答案 0 :(得分:1)

您可以使用plotBands

 xAxis: {        
        plotBands: [{ // mark the weekend
            color: 'rgba(120,120,150,0.3)',
            from: 2,
            to: 4
        },{ // mark the weekend
            color: 'rgba(255,0,150,0.3)',
            from: 3,
            to: 5
        }]
  }

示例:http://jsfiddle.net/v89Xw/