From 10ad741a22797b6710be1091d9e502e71929f255 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Fri, 17 Sep 2010 21:24:35 +0200 Subject: automatic alignment of graph legend Function fill_ds_names is renamed to parse_ds_names and now also appends spaces to ds_names to make them equal of lenght. --- plugin/netlink.php | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'plugin/netlink.php') diff --git a/plugin/netlink.php b/plugin/netlink.php index f9b4fa6..9352f66 100644 --- a/plugin/netlink.php +++ b/plugin/netlink.php @@ -23,7 +23,7 @@ switch($obj->args['type']) { case 'if_dropped': $obj->data_sources = array('rx', 'tx'); $obj->ds_names = array( - 'rx' => 'Receive ', + 'rx' => 'Receive', 'tx' => 'Transmit', ); $obj->colors = array( @@ -36,7 +36,7 @@ switch($obj->args['type']) { case 'if_errors': $obj->data_sources = array('rx', 'tx'); $obj->ds_names = array( - 'rx' => 'Receive ', + 'rx' => 'Receive', 'tx' => 'Transmit', ); $obj->colors = array( @@ -56,7 +56,7 @@ switch($obj->args['type']) { case 'if_octets': $obj->data_sources = array('rx', 'tx'); $obj->ds_names = array( - 'rx' => 'Receive ', + 'rx' => 'Receive', 'tx' => 'Transmit', ); $obj->colors = array( @@ -69,7 +69,7 @@ switch($obj->args['type']) { case 'if_packets': $obj->data_sources = array('rx', 'tx'); $obj->ds_names = array( - 'rx' => 'Receive ', + 'rx' => 'Receive', 'tx' => 'Transmit', ); $obj->colors = array( @@ -79,16 +79,15 @@ switch($obj->args['type']) { $obj->rrd_title = sprintf('Interface Packets (%s)', $obj->args['pinstance']); $obj->rrd_vertical = 'Packets/s'; break; - break; case 'if_rx_errors': $obj->data_sources = array('value'); $obj->ds_names = array( - 'crc' => 'CRC ', - 'fifo' => 'FiFo ', - 'frame' => 'Frame ', + 'crc' => 'CRC', + 'fifo' => 'FiFo', + 'frame' => 'Frame', 'length' => 'Lenght', 'missed' => 'Missed', - 'over' => 'Over ', + 'over' => 'Over', ); $obj->colors = array( 'crc' => '00e000', @@ -104,11 +103,11 @@ switch($obj->args['type']) { case 'if_tx_errors': $obj->data_sources = array('value'); $obj->ds_names = array( - 'aborted' => 'Aborted ', - 'carrier' => 'Carrier ', - 'fifo' => 'FiFo ', + 'aborted' => 'Aborted', + 'carrier' => 'Carrier', + 'fifo' => 'FiFo', 'heartbeat'=> 'Heartbeat', - 'window' => 'Window ', + 'window' => 'Window', ); $obj->colors = array( 'aborted' => 'f00000', -- cgit v1.1