score:19

Accepted answer

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/

score:0

you could simply set the max attribute to the max value you will have:

yaxis: {

            max:650 //here
            plotlines...

        },

score:2

in some cases, wergeld's solution would be preferable than jank's solution, especially when you are not sure about min and minrange. but wergeld's solution has a minor issue. if you point your mouse over the plot line, it will show a point and tooltip on the point. to avoid this, i have modified his solution and added enablemousetracking to get rid of the problem.

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

see updated jsfiddle: http://jsfiddle.net/4r5hh/570/

score:32

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.


Related Query

More Query from same tag