From 7c2aba0028c11f5868eb802a70f37debc108e8bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Ple=C3=9F?= Date: Sun, 4 Sep 2022 13:18:58 +0200 Subject: [PATCH] removed graph code --- public/js/graph.js | 41 ----------------------------------------- views/index.jade | 1 - 2 files changed, 42 deletions(-) delete mode 100644 public/js/graph.js diff --git a/public/js/graph.js b/public/js/graph.js deleted file mode 100644 index a870d5a..0000000 --- a/public/js/graph.js +++ /dev/null @@ -1,41 +0,0 @@ - - -$(function() { - - // TODO: we could try Rickshaw.Graph.JSONP instead of using jQuery getJSON - // http://code.shutterstock.com/rickshaw/ - - $.getJSON("/api/usercount", function(data, textStatus, jqXHR) { - - var offset = new Date().getTimezoneOffset(); - var newData = []; - - // TODO: we could change the API to directly give us { x: , y: } objects - - for (var i = 0; i < data.datapoints.length; i++) { - var date = moment(data.datapoints[i].at).unix() - offset * 60; - var value = parseInt(data.datapoints[i].value); - newData.push({x: date, y: value}); - } - - var graph = new Rickshaw.Graph( { - element: document.querySelector("#graph"), - renderer: 'line', - series: [ { - data: newData, - name: 'Benutzer', - color: 'steelblue' - } ] - } ); - - new Rickshaw.Graph.Axis.Time({graph: graph}).render(); - new Rickshaw.Graph.Axis.Y({graph: graph}).render(); - new Rickshaw.Graph.HoverDetail({ graph: graph, yFormatter: function (y) { return y.toFixed(0) } }); - - graph.render(); - - }); - - - -}); diff --git a/views/index.jade b/views/index.jade index 43b0f7d..525cd5e 100644 --- a/views/index.jade +++ b/views/index.jade @@ -36,7 +36,6 @@ block scripts script(type="text/javascript",src="/js/vendor/d3.layout.min.js") script(type="text/javascript",src="/js/vendor/rickshaw.min.js") script(type="text/javascript",src="/js/vendor/moment.min.js") - script(type="text/javascript",src="/js/graph.js") script(type="text/javascript",src="/js/vendor/raphael.2.1.0.min.js") script(type="text/javascript",src="/js/vendor/justgage.1.0.1.min.js")