diff --git a/scripts/pi-hole/js/index.js b/scripts/pi-hole/js/index.js index 9849d7aa1..44f1a7f9a 100644 --- a/scripts/pi-hole/js/index.js +++ b/scripts/pi-hole/js/index.js @@ -538,8 +538,14 @@ function updateForwardDestinationsPie() { values.push([key, value, THEME_COLORS[i++ % THEME_COLORS.length]]); }); - // Move the "other" element to the end of the array - values.push(values.splice(values.indexOf("other"), 1)[0]); + // Show "Other" destination as the last graphic item and only if it's different than zero + var other = values.splice( + values.findIndex(arr => arr.includes("other")), + 1 + )[0]; + if (other[1] !== 0) { + values.push(other); + } // Split data into individual arrays for the graphs values.forEach(function (value) {