diff options
author | Parker Berberian <pberberian@iol.unh.edu> | 2020-03-16 18:52:03 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2020-03-16 18:52:03 +0000 |
commit | d5b4f4c77534824430fd8e2d3f15e5f7ed6303f5 (patch) | |
tree | 8bd6fffb858840d6307631aefdd5cf4c721c6c65 /src/templates/base | |
parent | 0db3a84d9d9ed213983a517efd35c339537ef472 (diff) | |
parent | aaff0c1a5abc850db49dc72a79abb581be8cfcfc (diff) |
Merge "Fixed a few bugs for the stats functions and created a few tests."
Diffstat (limited to 'src/templates/base')
-rw-r--r-- | src/templates/base/booking/stats.html | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/templates/base/booking/stats.html b/src/templates/base/booking/stats.html index a78f793..4c06b71 100644 --- a/src/templates/base/booking/stats.html +++ b/src/templates/base/booking/stats.html @@ -5,20 +5,26 @@ {{ block.super }} <script src="{% static "node_modules/plotly.js-dist/plotly.js" %}"></script> <script> + function drawGraph(data, graph_id, graph_title){ var container = document.getElementById(graph_id); var plot_data = { x: data[0], y: data[1], - fill: "tonexty", + line: {shape: "hv"}, type: "scatter", - mode: "none", + mode: "lines+makers", }; var layout = { - title: graph_title + title: graph_title, + yaxis: { + rangemode: 'tozero', + autorange: true + } }; Plotly.newPlot(container, [plot_data], layout); } -function getData(){ + +function getData() { var req = new XMLHttpRequest(); var url = "/booking/stats/json"; var day_input = document.getElementById("number_days"); @@ -37,6 +43,7 @@ function getData(){ req.open("GET", url, true); req.send(); } + </script> {% endblock %} |