Thank you! this worked perfectly 
If I may ask in this same topic, what would be the optimal way for live updating the graph that comes from a csv? I was able to do it so, that it runs this makeplot() every 1second, but it seems to use an unnecessary amount of processor. Using extendtraces might do the trick, but I can’t figure out how to implement it to a code below, that uses csv as data…
function makeplot() {
Plotly.d3.csv(“path to csv”, function(data){
Plotly.d3.csv(“path to csv”, function(data2){
Plotly.d3.csv(“path to csv”, function(data3){
var x1 = [], y1 = [];
var x2 = [], y2 = [];
var x3 = [], y3 = [];
for (var i=0; i<data.length; i++) {
row = data[i];
x1.push( row['Date'] );
y1.push( row['Usage'] );
}
for (var i=0; i<data2.length; i++) {
row = data_creo[i];
x2.push( row['Date'] );
y2.push( row['Usage'] );
}
for (var i=0; i<data3.length; i++) {
row = data3[i];
x3.push( row['Date'] );
y3.push( row['Usage'] );
}
var trace1 = [{
x: x1,
y: y1,
name: "title1",
mode: 'lines',
}];
var trace2 = [{
x: x2,
y: y2,
name: "title",
mode: 'lines',
}];
var trace3 = [{
x: x3,
y: y3,
name: "Name",
mode: 'lines'
}];
var layout = {
title: 'Data',
xaxis: {
title: 'Date',
},
yaxis: {
title: 'Usage'
}
};
var AllData =[trace1[0], trace2[0], trace3[0]];
Plotly.newPlot('myDiv', AllData, layout, {displayModeBar: false});
});
});
});
};
makeplot();