From fc0024faa2953f2065c0485378c7c1a6053401cc Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 27 Dec 2016 15:54:36 +0100 Subject: [PATCH] Can now inform about the lack of certain charts [skip ci] --- public/js/ff/charts.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/public/js/ff/charts.js b/public/js/ff/charts.js index 7180a9c131..de470ba9e4 100644 --- a/public/js/ff/charts.js +++ b/public/js/ff/charts.js @@ -180,7 +180,6 @@ function doubleYNonStackedChart(URI, container) { } - /** * * @param URI @@ -253,11 +252,17 @@ function drawAChart(URI, container, chartType, options, colorData) { console.log(chartType + " chart in " + container + " has no data."); // remove the chart container + parent var holder = $('#' + container).parent().parent(); - if (holder.hasClass('box')) { + if (holder.hasClass('box') || holder.hasClass('box-body')) { // find box-body: - var boxBody = holder.find('.box-body'); + var boxBody; + if (!holder.hasClass('box-body')) { + boxBody = holder.find('.box-body'); + } else { + boxBody = holder; + } boxBody.empty().append($('

').append($('').text(noDataForChart))); - //holder.remove(); + } else { + console.log("Want to add text but holder has classes: " + holder.attr("class")); } return; }