How to always show the plotLine in HighCharts?

后端 未结 4 809
北恋
北恋 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:04

    One other option that does not introduce data points:

    yAxis: {
        minRange:450,
        min:0,
        plotLines:[{
            value:450,
            color: '#ff0000',
            width:2,
            zIndex:4,
            label:{text:'goal'}
        }]
    },
    

    This sets the minimum for the yAxis to 0 (this is unlikely to be false in this case) and the minimum Range to 450.

    See updated fiddle.

提交回复
热议问题