2011-09-23 13:54:40 +00:00
|
|
|
<?php
|
2015-07-13 20:10:26 +02:00
|
|
|
$scale_min = '0';
|
|
|
|
$scale_max = '100';
|
2011-09-23 13:54:40 +00:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
require 'includes/graphs/common.inc.php';
|
2011-09-23 13:54:40 +00:00
|
|
|
|
2012-04-09 23:00:31 +00:00
|
|
|
$rrd_options .= " COMMENT:' Cur Max\\n'";
|
2011-09-23 13:54:40 +00:00
|
|
|
|
2015-07-15 22:04:19 +01:00
|
|
|
$colour = toner2colour($toner['toner_descr'], 100 - $toner['toner_current']);
|
2015-07-13 20:10:26 +02:00
|
|
|
if ($colour['left'] == null) {
|
|
|
|
$colour['left'] = 'CC0000';
|
|
|
|
}
|
2011-09-23 13:54:40 +00:00
|
|
|
|
2016-10-24 21:40:39 +00:00
|
|
|
$descr = safedescr(substr(str_pad($toner['toner_descr'], 26), 0, 26));
|
2011-09-23 13:54:40 +00:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
$background = get_percentage_colours((100 - $toner['toner_current']));
|
2011-09-23 13:54:40 +00:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
$rrd_options .= ' DEF:toner'.$toner['toner_id'].'='.$rrd_filename.':toner:AVERAGE ';
|
2011-09-23 13:54:40 +00:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
$rrd_options .= ' LINE1:toner'.$toner['toner_id'].'#'.$colour['left'].":'".$descr."' ";
|
2011-09-23 13:54:40 +00:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
$rrd_options .= ' AREA:toner'.$toner['toner_id'].'#'.$background['right'].':';
|
|
|
|
$rrd_options .= ' GPRINT:toner'.$toner['toner_id'].":LAST:'%5.0lf%%'";
|
2016-10-25 09:53:35 -04:00
|
|
|
$rrd_options .= ' GPRINT:toner'.$toner['toner_id'].':MAX:%5.0lf%%\l';
|