Improve the formating of some graphs (#5507)

This commit is contained in:
David Bell
2017-01-24 09:53:38 +00:00
committed by Neil Lathwood
parent 998750ddd9
commit 755860fec5
6 changed files with 8 additions and 46 deletions

View File

@@ -2,31 +2,14 @@
require 'includes/graphs/common.inc.php';
if ($width > '500') {
$descr_len = 24;
// FIXME may even be more imo?
} else {
$descr_len = 12;
$descr_len += round(($width - 250) / 8);
}
$descr_len = 12;
if ($nototal) {
$descr_len += '2';
$unitlen += '2';
}
$unit_text = str_pad(truncate($unit_text, $unitlen), $unitlen);
if ($width > '500') {
$rrd_options .= " COMMENT:'".substr(str_pad($unit_text, ($descr_len + 5)), 0, ($descr_len + 5))."Now Min Max Avg\l'";
if (!$nototal) {
$rrd_options .= " COMMENT:'Total '";
}
$rrd_options .= " COMMENT:'\l'";
} else {
$rrd_options .= " COMMENT:'".substr(str_pad($unit_text, ($descr_len + 5)), 0, ($descr_len + 5))."Now Min Max Avg\l'";
}
$rrd_options .= " COMMENT:'".rrdtool_escape($unit_text, $descr_len)." Now Min Max Avg\l'";
$unitlen = '10';
if ($nototal) {