score:1

Accepted answer

This feature should be available in Highstock soon. For more information please check this issue: https://github.com/highcharts/highcharts/issues/15361

For now, you can preprocess your data. Example:

const getCumulativeData = (data) => {
    const cumulativeData = [];

    data.forEach((dataEl, index) => {
        if (cumulativeData[index - 1]) {
            cumulativeData.push([dataEl[0], dataEl[1] + cumulativeData[index - 1][1]]);
        } else {
            cumulativeData.push(dataEl);
        }
    });

    return cumulativeData;
};

Live demo: http://jsfiddle.net/BlackLabel/846cgxhL/


Related Articles