score:1

Accepted answer

Use setData method:

var data = [{
        "data": [70]
    },
    {
        "data": [-30]
    }
]

var chart = Highcharts.chart('container', {
    series: [{
        color: 'red',
        data: []
    }, {
        color: 'blue',
        data: []
    }]
});

document.getElementById("data").addEventListener('click', function() {
    data.forEach(function(el, i) {
        chart.series[i].setData(el.data);
    });
});

Live demo: http://jsfiddle.net/BlackLabel/z5aLvgxq/

API: https://api.highcharts.com/class-reference/Highcharts.Series#setData


Related Query

More Query from same tag