Start labelling axes

This commit is contained in:
Herbert Wolverson 2023-03-22 15:46:09 +00:00
parent 1daf727374
commit 7f746d71a1
2 changed files with 8 additions and 8 deletions

View File

@ -329,7 +329,7 @@
{x: entries.x[0], y:entries.y[0].reverse(), name: 'Download', type: 'scatter'}, {x: entries.x[0], y:entries.y[0].reverse(), name: 'Download', type: 'scatter'},
{x: entries.x[1], y:entries.y[1].reverse(), name: 'Upload', type: 'scatter'}, {x: entries.x[1], y:entries.y[1].reverse(), name: 'Upload', type: 'scatter'},
]; ];
Plotly.newPlot(graph, graph_data, { margin: { l:0,r:0,b:0,t:0,pad:4 }, yaxis: { automargin: true }, xaxis: {automargin: true} }); Plotly.newPlot(graph, graph_data, { margin: { l:0,r:0,b:0,t:0,pad:4 }, yaxis: { automargin: true }, xaxis: {automargin: true, title: "Time since now (seconds)"} });
// Try to hide zeroes // Try to hide zeroes
for (let i=0; i<entries.y[2].length; i++) { for (let i=0; i<entries.y[2].length; i++) {
@ -347,7 +347,7 @@
{x: entries.x[4], y:entries.y[4].reverse(), name: 'Up Drops', mode: 'markers', marker: { size: 4 }}, {x: entries.x[4], y:entries.y[4].reverse(), name: 'Up Drops', mode: 'markers', marker: { size: 4 }},
{x: entries.x[5], y:entries.y[5].reverse(), name: 'Up Marks', mode: 'markers', marker: { size: 4 }}, {x: entries.x[5], y:entries.y[5].reverse(), name: 'Up Marks', mode: 'markers', marker: { size: 4 }},
]; ];
Plotly.newPlot(graph, graph_data, { margin: { l:0,r:0,b:0,t:0,pad:4 }, yaxis: { automargin: true }, xaxis: {automargin: true} }); Plotly.newPlot(graph, graph_data, { margin: { l:0,r:0,b:0,t:0,pad:4 }, yaxis: { automargin: true }, xaxis: {automargin: true, title: "Time since now (seconds)"} });
backlogX1.push(entries.x[6]); backlogX1.push(entries.x[6]);
backlogX2.push(entries.x[7]); backlogX2.push(entries.x[7]);
@ -369,7 +369,7 @@
{x: backlogX1[3], y:backlogY1[3].reverse(), type: 'scatter', name: 'Tin 3 Down'}, {x: backlogX1[3], y:backlogY1[3].reverse(), type: 'scatter', name: 'Tin 3 Down'},
{x: backlogX2[3], y:backlogY2[3].reverse(), type: 'scatter', name: 'Tin 3 Up'}, {x: backlogX2[3], y:backlogY2[3].reverse(), type: 'scatter', name: 'Tin 3 Up'},
]; ];
Plotly.newPlot(graph, graph_data, { margin: { l:0,r:0,b:0,t:0,pad:4 }, yaxis: { automargin: true }, xaxis: {automargin: true} }); Plotly.newPlot(graph, graph_data, { margin: { l:0,r:0,b:0,t:0,pad:4 }, yaxis: { automargin: true }, xaxis: {automargin: true, title: "Time since now (seconds)"} });
graph = document.getElementById("delayGraph"); graph = document.getElementById("delayGraph");
graph_data = [ graph_data = [
@ -382,14 +382,14 @@
{x: delaysX1[3], y:delaysY1[3].reverse(), type: 'scatter', name: 'Tin 3 Down'}, {x: delaysX1[3], y:delaysY1[3].reverse(), type: 'scatter', name: 'Tin 3 Down'},
{x: delaysX2[3], y:delaysY2[3].reverse(), type: 'scatter', name: 'Tin 3 Up'}, {x: delaysX2[3], y:delaysY2[3].reverse(), type: 'scatter', name: 'Tin 3 Up'},
]; ];
Plotly.newPlot(graph, graph_data, { margin: { l:0,r:0,b:0,t:0,pad:4 }, yaxis: { automargin: true }, xaxis: {automargin: true} }); Plotly.newPlot(graph, graph_data, { margin: { l:0,r:0,b:0,t:0,pad:4 }, yaxis: { automargin: true }, xaxis: {automargin: true, title: "Time since now (seconds)"} });
graph = document.getElementById("qlenGraph"); graph = document.getElementById("qlenGraph");
graph_data = [ graph_data = [
{x: qlenX1, y:qlenY1.reverse(), type: 'scatter', name: 'Down'}, {x: qlenX1, y:qlenY1.reverse(), type: 'scatter', name: 'Down'},
{x: qlenX2, y:qlenY2.reverse(), type: 'scatter', name: 'Up'}, {x: qlenX2, y:qlenY2.reverse(), type: 'scatter', name: 'Up'},
]; ];
Plotly.newPlot(graph, graph_data, { margin: { l:0,r:0,b:0,t:0,pad:4 }, yaxis: { automargin: true }, xaxis: {automargin: true} }); Plotly.newPlot(graph, graph_data, { margin: { l:0,r:0,b:0,t:0,pad:4 }, yaxis: { automargin: true }, xaxis: {automargin: true, title: "Time since now (seconds)"} });
}); });
} }
} }
@ -469,7 +469,7 @@
graph_data.push({x: xDown, y: yDown.reverse(), name: ip + " Down", type: 'scatter'}); graph_data.push({x: xDown, y: yDown.reverse(), name: ip + " Down", type: 'scatter'});
graph_data.push({x: xUp, y: yUp.reverse(), name: ip + " Up", type: 'scatter'}); graph_data.push({x: xUp, y: yUp.reverse(), name: ip + " Up", type: 'scatter'});
} }
Plotly.newPlot(graph, graph_data, { margin: { l:0,r:0,b:0,t:0,pad:4 }, yaxis: { automargin: true }, xaxis: {automargin: true} }); Plotly.newPlot(graph, graph_data, { margin: { l:0,r:0,b:0,t:0,pad:4 }, yaxis: { automargin: true, title: "Traffic (bits)" }, xaxis: {automargin: true, title: "Time since now (seconds)"} });
throughput_head += 1; throughput_head += 1;
if (throughput_head >= 300) { if (throughput_head >= 300) {
throughput_head = 0; throughput_head = 0;

View File

@ -282,7 +282,7 @@ class MultiRingBuffer {
{x: x, y:shaped.down, name: 'Shaped Download', type: 'scatter', fill: 'tozeroy', marker: {color: 'rgb(124,252,0)'}}, {x: x, y:shaped.down, name: 'Shaped Download', type: 'scatter', fill: 'tozeroy', marker: {color: 'rgb(124,252,0)'}},
{x: x, y:shaped.up, name: 'Shaped Upload', type: 'scatter', fill: 'tozeroy', marker: {color: 'rgb(124,252,0)'}}, {x: x, y:shaped.up, name: 'Shaped Upload', type: 'scatter', fill: 'tozeroy', marker: {color: 'rgb(124,252,0)'}},
]; ];
Plotly.newPlot(graph, data, { margin: { l:0,r:0,b:0,t:0,pad:4 }, yaxis: { automargin: true }, xaxis: {automargin: true, title: "Time since now (seconds)"} }, { responsive: true }); Plotly.newPlot(graph, data, { margin: { l:0,r:0,b:0,t:0,pad:4 }, yaxis: { automargin: true, title: "Traffic (bits)" }, xaxis: {automargin: true, title: "Time since now (seconds)"} }, { responsive: true });
} }
} }
@ -366,7 +366,7 @@ class RttHistogram {
{ x: this.x, y: this.entries, type: 'bar', marker: { color: this.x, colorscale: 'RdBu' } } { x: this.x, y: this.entries, type: 'bar', marker: { color: this.x, colorscale: 'RdBu' } }
] ]
let graph = document.getElementById(target_div); let graph = document.getElementById(target_div);
Plotly.newPlot(graph, gData, { margin: { l: 0, r: 0, b: 35, t: 0 }, xaxis: { title: 'TCP Round-Trip Time (ms)' } }, { responsive: true }); Plotly.newPlot(graph, gData, { margin: { l: 40, r: 0, b: 35, t: 0 }, yaxis: { title: "# Hosts" }, xaxis: { title: 'TCP Round-Trip Time (ms)' } }, { responsive: true });
} }
} }