Don't draw an e-r graph if no data

If there are no data for a bug query, just don't try to draw the graph.
Apparently the flot lib had a recent change which breaks drawing graphs
with no data.  This seems like a sensible idea anyway.

Instead the string "No matches" is substituted for the graph.

Change-Id: I3733974a9ec180fef2ca74c5e799155cadd07b7d
This commit is contained in:
James E. Blair 2013-11-27 12:00:27 -08:00
parent b266a26a98
commit 35816b5802

View File

@ -40,11 +40,15 @@ function update() {
} }
div = div.find(".graph"); div = div.find(".graph");
$.plot(div, bug['data'], if (bug['data'].length > 0) {
{xaxis: { $.plot(div, bug['data'],
mode: "time" {xaxis: {
}} mode: "time"
); }}
);
} else {
div.html("No matches");
}
}); });
$.each($('.bug-container'), function(i, container) { $.each($('.bug-container'), function(i, container) {