Commit 5f3d49be authored by Heinz N. Gies's avatar Heinz N. Gies

Fix graph display

parent 7b2c1162
...@@ -62,8 +62,9 @@ if (QueryString.metric && QueryString.bucket) { ...@@ -62,8 +62,9 @@ if (QueryString.metric && QueryString.bucket) {
function render_metrics(metrics, markers) { function render_metrics(start, metrics, markers) {
var data; var data,
legend = [];
if (metrics.length > 0) { if (metrics.length > 0) {
$("#events").append($("<h3></h3>").text("Metrics")).append($("<hr/>")) $("#events").append($("<h3></h3>").text("Metrics")).append($("<hr/>"))
data = metrics.map(function(s) { data = metrics.map(function(s) {
...@@ -114,7 +115,7 @@ function render_event(event) { ...@@ -114,7 +115,7 @@ function render_event(event) {
div.append(hdr) .append(tbl) div.append(hdr) .append(tbl)
$("#events").append(div) $("#events").append(div)
} }
function render_events(events) { function render_events(start, events) {
if (events.length > 0) { if (events.length > 0) {
$("#events").append($("<h3></h3>").text("Events")).append($("<hr/>")) $("#events").append($("<h3></h3>").text("Events")).append($("<hr/>"))
events.map(render_event) events.map(render_event)
...@@ -133,7 +134,6 @@ function q() { ...@@ -133,7 +134,6 @@ function q() {
$("#timewrap").show(); $("#timewrap").show();
var start = res.start * 1000, var start = res.start * 1000,
legend = [],
markers = []; markers = [];
gres = res gres = res
...@@ -143,8 +143,8 @@ function q() { ...@@ -143,8 +143,8 @@ function q() {
events = res.results.filter(function(e) { events = res.results.filter(function(e) {
return e.type == "events" return e.type == "events"
}); });
render_metrics(metrics, markers); render_metrics(start, metrics, markers);
render_events(events); render_events(start, events);
}); });
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment