Index: trunk/ippMonitor/raw/czartool_labels.php
===================================================================
--- trunk/ippMonitor/raw/czartool_labels.php	(revision 42921)
+++ trunk/ippMonitor/raw/czartool_labels.php	(revision 42922)
@@ -1846,5 +1846,5 @@
     exec("neb-host |cut -b 17-30,86-", $hostnoteall);
 
-    $sql = "SELECT host, format(total, 2), format(available, 2), format(used, 2), writable, readable, format(used/total*100,3) as ratio FROM hosts where xattr <> 3 ";
+    $sql = "SELECT host, format(total, 2), format(available, 2), format(used, 2), writable, readable, format(used/total*100,3) as ratio FROM hosts where xattr <> 3 ORDER BY CASE WHEN ROUND(used/total*100,3) = 100 THEN 0 ELSE 1 END, CASE WHEN host LIKE '%\_bck.0' THEN 1 ELSE 0 END, host;";
     $qry = $db->query($sql);
 
@@ -1854,7 +1854,13 @@
     }
 
+    $sqlMax = "SELECT MAX(total) AS max_total FROM hosts WHERE xattr <> 3";
+    $qryMax = $db->query($sqlMax);
+    $maxUsed = 0;
+
+    if ($qryMax && $qryMax->fetchInto($rowMax)) {
+        $maxUsed = $rowMax[0];  // max_total value
+    }
+
     $dataRows = array();
-    $maxUsed = 0;   // initialize before the while loop
-
     while ($qry->fetchInto($row)) {
         // Access by index
@@ -1866,9 +1872,4 @@
         $readable  = $row[5]; // 1
         $ratio     = $row[6]; // 86.4939 %
-
-        // update maxUsed
-        if ($total > $maxUsed) {
-            $maxUsed = $total/2;
-        }
 
         // Match notes
@@ -1893,5 +1894,5 @@
         } elseif ($available < 1) {
             $used      = $maxUsed;
-            $available = $maxUsed;
+            $available = 0;
             $status    = "offline";
             $usedColor = "white";
