diff options
author | Sean <ssmith@iol.unh.edu> | 2020-03-03 10:54:20 -0500 |
---|---|---|
committer | Sean <ssmith@iol.unh.edu> | 2020-03-16 14:50:00 -0400 |
commit | aaff0c1a5abc850db49dc72a79abb581be8cfcfc (patch) | |
tree | 385931496aba116c6d8f2c4f1cefc99e92b1e591 /src/templates/base | |
parent | 8eab4c4a801a367f74347627c19dd721f75c7a62 (diff) |
Fixed a few bugs for the stats functions and created a few tests.
Signed-off-by: Sean <ssmith@iol.unh.edu>
Change-Id: I2e4598811bddabe5b7447c3a92d39d16acb77a03
Signed-off-by: Sean <ssmith@iol.unh.edu>
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 %} |