width = $width; $obj->heigth = $heigth; $obj->colors = array( 'value' => '0000f0', ); switch($obj->args['type']) { case 'charge': $obj->ds_names = array('value' => 'Charge'); $obj->rrd_title = sprintf('Charge (Battery %s)', $obj->args['pinstance']); $obj->rrd_vertical = 'Ampere hours'; break; case 'current': $obj->ds_names = array('value' => 'Current'); $obj->rrd_title = sprintf('Current (Battery %s)', $obj->args['pinstance']); $obj->rrd_vertical = 'Ampere'; break; case 'voltage': $obj->ds_names = array('value' => 'Voltage'); $obj->rrd_title = sprintf('Voltage (Battery %s)', $obj->args['pinstance']); $obj->rrd_vertical = 'Volt'; break; } $obj->rrd_format = '%4.1lf'; collectd_flush($obj->identifiers); $obj->rrd_graph();