datefile = document.getElementById("datafiles").value; numbername = document.getElementById("numbers").value; datatype = document.getElementById("datatype").value; //alert("Auslesen: " + datefile + " " + numbername); _domainname = getDomainname(); fetch(_domainname + '/fileserver/log/data/' + datefile) .then(response => { // handle the response if (response.status == 404) { firework.launch("No log data available for " + dateString, 'warning', 10000); } response.text() .then( result => { var lines = result.split("\n"); var trace = { x: [], y: [], type: 'scatter' }; var timex = 1; for (let line of lines) { { console.log(line); if (line.split(",")[1] == numbername) { var value = line.split(",")[datatype]; var time = line.split(",")[0]; console.log("> "+time+" "+value+"\n"); trace.x.push(time); // timex += 1; trace.y.push(value); } } } console.log(trace); var data = [trace]; Plotly.newPlot('chart', data); }); }).catch((error) => { // handle the error console.log(error); });