如何在Highcharts(areachart)中添加边界到区域范围

时间:2018-05-28 13:58:12

标签: graph highcharts range axis

http://jsfiddle.net/7gvuA/30/ 1

adding a border to area range in area chart(Highcharts)

Line to area chart for the first series

How to add a line to start and end of the first series in Highcharts.

1 个答案:

答案 0 :(得分:0)

无法通过图表选项实现,但这个简单的自定义代码完成了这项工作:

  events: {
    load: function() {
      var borderSeries = this.series[2];
      borderSeries.area.attr({ // borderSeries.area is SVGElement
        stroke: 'red',
        'stroke-width': 5,
        d: borderSeries.area.d + ' Z' // close the area
      });
    }
  } 

直接改变区域系列的SVG。

现场演示: http://jsfiddle.net/BlackLabel/edw44ux4/

API参考: https://api.highcharts.com/class-reference/Highcharts.SVGElement#attr