This commit is contained in:
James Cole 2020-02-23 14:01:08 +01:00
parent e0c99fa80c
commit af503597e6
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -376,13 +376,17 @@ function drawAChart(URI, container, chartType, options, colorData) {
containerObj.removeClass('general-chart-error'); containerObj.removeClass('general-chart-error');
// if result is empty array, or the labels array is empty, show error. // if result is empty array, or the labels array is empty, show error.
// console.log(URI);
// console.log(data.length);
// console.log(typeof data.labels);
// console.log(data.labels.length);
if ( if (
// is undefined // is undefined
typeof data === 'undefined' || typeof data === 'undefined' ||
// is empty // is empty
0 === data.length || 0 === data.length ||
// isn't empty but contains no labels // isn't empty but contains no labels
(data.length > 0 && typeof data.labels !== 'undefined' && 0 === data.labels.length) (typeof data === 'object' && typeof data.labels === 'object' && 0 === data.labels.length)
) { ) {
// remove the chart container + parent // remove the chart container + parent
var holder = $('#' + container).parent().parent(); var holder = $('#' + container).parent().parent();