Fix issue with equal values

This commit is contained in:
José González 2022-04-29 12:49:01 +02:00
parent 46e39e9f68
commit 118b845fa0
1 changed files with 7 additions and 2 deletions

View File

@ -463,8 +463,13 @@ class TopNWidget extends Widget
// Calculation of max-min values for show in graph.
$calc = (ceil((5 * (float) $module[$display]) / 100) + $module[$display]);
// Set of max-min values for graph.
$valueMax = ((int) $module[$display] >= $valueMax) ? $calc : $valueMax;
$valueMin = ((int) $module[$display] <= $valueMin) ? $calc : $valueMin;
$valueMax = ((int) $module[$display] >= $valueMax) ? $calc : (int) $valueMax;
$valueMin = ((int) $module[$display] < $valueMin) ? $calc : (int) $valueMin;
}
// This change is for get more space between values.
if ((int) $valueMax === (int) $valueMin) {
$valueMax += 10;
}
$height = (count($data_hbar) * 25 + 35);