How to always show the plotLine in HighCharts?

后端 未结 4 800
北恋
北恋 2020-12-16 11:01

I am creating a HighChart with a plotLine in it. The plotLine has a fixed value, while the data can vary between charts.

HighChart scales the y-axis automatically ba

4条回答
  •  半阙折子戏
    2020-12-16 12:02

    You need to add in a point to you chart but disable the marker. I added a new series with scatter plot type and its value equal to the goal value:

    {
         name: 'Goal',
         type: 'scatter',
         marker: {
              enabled: false
         },
         data: [450]
    }
    

    See updated jsFiddle: http://jsfiddle.net/wergeld/4R5HH/4/

提交回复
热议问题