mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix #3145
This commit is contained in:
parent
a486d65893
commit
e0c99fa80c
13
public/v1/js/ff/charts.js
vendored
13
public/v1/js/ff/charts.js
vendored
@ -374,9 +374,16 @@ function drawAChart(URI, container, chartType, options, colorData) {
|
|||||||
|
|
||||||
$.getJSON(URI).done(function (data) {
|
$.getJSON(URI).done(function (data) {
|
||||||
containerObj.removeClass('general-chart-error');
|
containerObj.removeClass('general-chart-error');
|
||||||
console.log(data);
|
|
||||||
if (!(Array.isArray(data) && data.length) ||
|
// if result is empty array, or the labels array is empty, show error.
|
||||||
(typeof data.labels != 'undefined' && data.labels.length === 0)) {
|
if (
|
||||||
|
// is undefined
|
||||||
|
typeof data === 'undefined' ||
|
||||||
|
// is empty
|
||||||
|
0 === data.length ||
|
||||||
|
// isn't empty but contains no labels
|
||||||
|
(data.length > 0 && typeof data.labels !== 'undefined' && 0 === data.labels.length)
|
||||||
|
) {
|
||||||
// remove the chart container + parent
|
// remove the chart container + parent
|
||||||
var holder = $('#' + container).parent().parent();
|
var holder = $('#' + container).parent().parent();
|
||||||
if (holder.hasClass('box') || holder.hasClass('box-body')) {
|
if (holder.hasClass('box') || holder.hasClass('box-body')) {
|
||||||
|
Loading…
Reference in New Issue
Block a user