From 98b09fd7983ab3a1f7a1646b44578cc0191eef44 Mon Sep 17 00:00:00 2001 From: saksham115 Date: Fri, 25 Aug 2017 03:16:58 +0530 Subject: Addition of slope line to graph JIRA: STORPERF-195 Change-Id: I0d674c77976ba7378143edcef4485a6b90a19fc7 Signed-off-by: saksham115 --- .../src/templates/plot_tables.html | 32 ++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'docker/storperf-reporting') 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 = ""; @@ -195,7 +223,7 @@ table += ""; table += ""; + ""; table += "
Allowed Maximum Data Excursion: " + 0.2*average + " Measured Maximum Data Excursion: " + data["range"] + "
Allowed Maximum Slope Excursion: " + 0.1*average + - " Measured Maximum Data Excursion: " + data["slope"] + "
Measured Maximum Slope Excursion: " + data["slope"] + "
"; document.getElementById("report").innerHTML = table; -- cgit 1.2.3-korg