removed graph code

This commit is contained in:
Lucas Pleß 2022-09-04 13:18:58 +02:00
parent b9f4eb5dd5
commit 7c2aba0028
2 changed files with 0 additions and 42 deletions

View File

@ -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();
});
});

View File

@ -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")