From 35816b5802b6e8b39ff316526a1361b1d7da1a97 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Wed, 27 Nov 2013 12:00:27 -0800 Subject: [PATCH] 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 --- .../files/elastic-recheck/elastic-recheck.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/openstack_project/files/elastic-recheck/elastic-recheck.js b/modules/openstack_project/files/elastic-recheck/elastic-recheck.js index f2d72d96c5..225c182504 100644 --- a/modules/openstack_project/files/elastic-recheck/elastic-recheck.js +++ b/modules/openstack_project/files/elastic-recheck/elastic-recheck.js @@ -40,11 +40,15 @@ function update() { } div = div.find(".graph"); - $.plot(div, bug['data'], - {xaxis: { - mode: "time" - }} - ); + if (bug['data'].length > 0) { + $.plot(div, bug['data'], + {xaxis: { + mode: "time" + }} + ); + } else { + div.html("No matches"); + } }); $.each($('.bug-container'), function(i, container) {