mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-30 16:14:21 +02:00
Fix legend colorisation with zero values in slices definition
This commit is contained in:
+4
-4
@@ -571,8 +571,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (var id in elems) {
|
for (var id in elems) {
|
||||||
if ((!legendOptions.slices[i].min || elems[id].value >= legendOptions.slices[i].min)
|
if ((typeof legendOptions.slices[i].min == 'undefined' || elems[id].value >= legendOptions.slices[i].min)
|
||||||
&& (!legendOptions.slices[i].max || elems[id].value < legendOptions.slices[i].max)
|
&& (typeof legendOptions.slices[i].max == 'undefined' || elems[id].value < legendOptions.slices[i].max)
|
||||||
) {
|
) {
|
||||||
(function(id) {
|
(function(id) {
|
||||||
if (!label.hidden) {
|
if (!label.hidden) {
|
||||||
@@ -730,8 +730,8 @@
|
|||||||
*/
|
*/
|
||||||
$.fn.mapael.getLegendSlice = function (value, legend) {
|
$.fn.mapael.getLegendSlice = function (value, legend) {
|
||||||
for(var i = 0, length = legend.slices.length; i < length; ++i) {
|
for(var i = 0, length = legend.slices.length; i < length; ++i) {
|
||||||
if ((!legend.slices[i].min || value >= legend.slices[i].min)
|
if ((typeof legend.slices[i].min == 'undefined' || value >= legend.slices[i].min)
|
||||||
&& (!legend.slices[i].max || value < legend.slices[i].max)
|
&& (typeof legend.slices[i].max == 'undefined' || value < legend.slices[i].max)
|
||||||
) {
|
) {
|
||||||
return legend.slices[i];
|
return legend.slices[i];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user