JSFiddle - React, Tailwind, and code Playground

by vinodlouis

JavaScript

let s = 'const mjkg = [{data: [[17.81,47.00],[34.00,89.72]], type: "line", name:"9.5 MJ/kg", label:{show:true, position:"top", formatter:(en,i)=> (en.value[0] == 17.81) ? "" : "9.5 MJ/kg"}, itemStyle:{color:"grey"} },{data: [[14.71,47.00],[34.00,108.61]], type: "line", name:"11.5 MJ/kg", label:{show:true, position:"top", formatter:(en,i)=> (en.value[0] == 14.71) ? "" : "11.5 MJ/kg"}, itemStyle:{color:"grey"} },{data: [[12.00,53.33],[24.75,110.00]], type: "line", name:"16 MJ/kg", label:{show:true, position:"top", formatter:(en,i)=> (en.value[0] == 12.00) ? "" : "16 MJ/kg"}, itemStyle:{color:"grey"} },{data: [[16.64,47.00],[34.00,96.02]], type: "line", name:"10.2 MJ/kg", label:{show:true, position:"top", formatter:(en,i)=> (en.value[0] == 16.64) ? "" : "10.2 MJ/kg"}, itemStyle:{color:"grey"} },{data: [[15.62,47.00],[34.00,102.31], type: "line", name:"10.8 MJ/kg", label:{show:true, position:"top", formatter:(en,i)=> (en.value[0] == 15.62) ? "" : "10.8 MJ/kg"}, itemStyle:{color:"grey"} },{data: [[13.02,47.00],[30.46,110.00], type: "line", name:"13 MJ/kg", label:{show:true, position:"top", formatter:(en,i)=> (en.value[0] == 13.02) ? "" : "13 MJ/kg"}, itemStyle:{color:"grey"} },{data: [[12.00,48.33],[27.31,110.00], type: "line", name:"14.5 MJ/kg", label:{show:true, position:"top", formatter:(en,i)=> (en.value[0] == 12.00) ? "" : "14.5 MJ/kg"}, itemStyle:{color:"grey"} }] const da = [{data: [[16.35, 60.92], [23.09, 60.92], [27.24, 71.89],[27.24,87.03],[19.58,87.03],[16.35,72.65],[16.35, 60.92]], type: "line", name:"Design Area", itemStyle:{color:"green"}}, {data: [[19.58,87.03],[21.54,95.73],[29.97,95.73],[29.97,79.08],[27.24, 71.89]], type: "line", name:"Overload Area", itemStyle:{color:"orange"} }] const seriesInfo = ["Main_contr_Throughput_8_hour_avg", "Superheated_HP_steam_distrib_Thermal_load_waste_8_hour_avg"]; const seriesSorted = [data:response.map((el)=> el[seriesInfo[0]]).sort((a, b) => a - b),data:response.map((el)=> el[seriesInfo[1]]).sort((a, b) => a - b)]...