diff options
Diffstat (limited to 'src/templates/base/booking/stats.html')
-rw-r--r-- | src/templates/base/booking/stats.html | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/templates/base/booking/stats.html b/src/templates/base/booking/stats.html index 94239f9..4c06b71 100644 --- a/src/templates/base/booking/stats.html +++ b/src/templates/base/booking/stats.html @@ -3,22 +3,28 @@ {% block extrahead %} {{ block.super }} -<script src="https://cdn.plot.ly/plotly-latest.min.js"></script> +<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 %} |