score:0

I tried to assign an id to plotLine,

First remove the plotline completely by removePlotLine(id), then added it back by addPlotLine. It works great for me.

function upgradePlotLine(new_line) {
    chart.yAxis[0].removePlotLine('my_line');
    chart.yAxis[0].addPlotLine(new_line);
}

score:1

Here's what worked for me http://jsfiddle.net/tx1kt0bj/2/

var plotBand = tempAxis.plotLinesAndBands[0];

$.extend(plotBand.options, {
    color: '#000',
    to: 10,
    from: 2
});
plotBand.svgElem.destroy();
plotBand.svgElem = undefined;
plotBand.render();

score:3

just add this code and then you can use the plotline.update method

    //Add support for update method
    Highcharts.PlotLineOrBand.prototype.update = function (newOptions){
        var plotBand = this;
        Highcharts.extend(plotBand.options, newOptions);
        if (plotBand.svgElem) {
            plotBand.svgElem.destroy();
            plotBand.svgElem = undefined;
            plotBand.render();
        }
    }

score:5

You can only destroy and create new plotLins, because update() function is not available.


Related Query

More Query from same tag