const netResult = ChartEditor.getLoadedData().lunapark_api;
var params = ChartEditor.getParams()
//console.log('Data', netResult);

var series = [];

Object.keys(netResult.cases[params.case_id]).forEach((code) => {
    switch (code) {
        case "0":
            color = 'grey'
            visible = false
            break;
        default:
            color = 'blue'
            visible = true
    }
    series.push(
        {
            yAxis: 0,
            name: code,
            data: netResult.cases[params.case_id][code],
            type: 'area',
            color: color,
            visible: visible
        }
    )
});

series.push({
        yAxis: 1,
        type: 'line',
        id: 'rps',
        title: 'rps',
        color: 'brown',
        opacity: 1,
        data: netResult.responses_per_second
    }
);
module.exports  = {
    graphs: series,
    categories_ms: netResult.ts
}
