diff options
author | saksham115 <saksham.agrawal@research.iiit.ac.in> | 2017-08-25 03:16:58 +0530 |
---|---|---|
committer | Mark Beierl <mark.beierl@dell.com> | 2017-08-25 14:45:42 +0000 |
commit | 98b09fd7983ab3a1f7a1646b44578cc0191eef44 (patch) | |
tree | 10aaefe4b2e099e145922f363a705db30fdb2106 /docker/storperf-reporting/src/templates | |
parent | 18ab8f84a745cf861b51c66f4bb8301bba27ba1e (diff) |
Addition of slope line to graph
JIRA: STORPERF-195
Change-Id: I0d674c77976ba7378143edcef4485a6b90a19fc7
Signed-off-by: saksham115 <saksham.agrawal@research.iiit.ac.in>
Diffstat (limited to 'docker/storperf-reporting/src/templates')
-rw-r--r-- | docker/storperf-reporting/src/templates/plot_tables.html | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/docker/storperf-reporting/src/templates/plot_tables.html b/docker/storperf-reporting/src/templates/plot_tables.html index 344f08b..a0770bf 100644 --- a/docker/storperf-reporting/src/templates/plot_tables.html +++ b/docker/storperf-reporting/src/templates/plot_tables.html @@ -185,7 +185,35 @@ name: '90%*Average', type: 'scatter' }; - var plot_data = [trace1,trace2,trace3,trace4]; + // Creating slope plot in var trace5 + var slope_y = []; + var slope_mid = parseInt(len/2); + // Init slope_y with average + for(var i = 0; i < len; i++){ + slope_y.push(average); + } + // Creating the slope plot + var i = slope_mid - 1; + var count = data["slope"]; + while(i >= 0){ + slope_y[i] -= count; + count += data["slope"]; + i--; + } + var i = slope_mid + 1; + var count = data["slope"]; + while(i < len){ + slope_y[i] += count; + count += data["slope"]; + i++; + } + var trace5 = { + x: x, + y: slope_y, + name: 'Slope', + type: 'scatter' + }; + var plot_data = [trace1,trace2,trace3,trace4,trace5]; Plotly.newPlot('graph',plot_data,layout); modal.style.display = "block"; table = "<table class='table table-bordered'>"; @@ -195,7 +223,7 @@ table += "<tr><td> Allowed Maximum Data Excursion: " + 0.2*average + "</td><td> Measured Maximum Data Excursion: " + data["range"] + "</td></tr>"; table += "<tr><td> Allowed Maximum Slope Excursion: " + 0.1*average + - "</td><td> Measured Maximum Data Excursion: " + data["slope"] + "</td></tr>"; + "</td><td> Measured Maximum Slope Excursion: " + data["slope"] + "</td></tr>"; table += "</tbody></table>"; document.getElementById("report").innerHTML = table; |