diff --git a/html/images/icons/arrow_updown.png b/html/images/icons/arrow_updown.png
new file mode 100755
index 000000000..20628c0d0
Binary files /dev/null and b/html/images/icons/arrow_updown.png differ
diff --git a/html/includes/graphs/device/cipsec_flow_stats.inc.php b/html/includes/graphs/device/cipsec_flow_stats.inc.php
index 26e310e82..0005c5d84 100755
--- a/html/includes/graphs/device/cipsec_flow_stats.inc.php
+++ b/html/includes/graphs/device/cipsec_flow_stats.inc.php
@@ -13,7 +13,7 @@ $i++;
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = "OutAuths";
$rrd_list[$i]['rra'] = "OutAuths";
-$rra_list[$i]['invert'] = 1;
+$rra_list[$i]['invert'] = "1";
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
@@ -23,7 +23,7 @@ $i++;
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = "OutEncrypts";
$rrd_list[$i]['rra'] = "OutEncrypts";
-$rra_list[$i]['invert'] = 1;
+$rra_list[$i]['invert'] = "1";
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
@@ -37,7 +37,7 @@ $i++;
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = "OutDrops";
$rrd_list[$i]['rra'] = "OutDrops";
-$rra_list[$i]['invert'] = 1;
+$rra_list[$i]['invert'] = "1";
@@ -49,7 +49,7 @@ $i++;
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = "OutAuthFail";
$rrd_list[$i]['rra'] = "OutAuthFails";
-$rra_list[$i]['invert'] = 1;
+$rra_list[$i]['invert'] = "1";
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
@@ -59,7 +59,7 @@ $i++;
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = "OutEncryptFails";
$rrd_list[$i]['rra'] = "OutEncryptFails";
-$rra_list[$i]['invert'] = 1;
+$rra_list[$i]['invert'] = "1";
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
diff --git a/html/includes/graphs/generic_multi_line.inc.php b/html/includes/graphs/generic_multi_line.inc.php
index a813dd766..3349c290d 100644
--- a/html/includes/graphs/generic_multi_line.inc.php
+++ b/html/includes/graphs/generic_multi_line.inc.php
@@ -27,7 +27,13 @@
$rrd_options .= " DEF:".$id."=$filename:$rra:AVERAGE";
$rrd_options .= " DEF:".$id."min=$filename:$rra:MIN";
$rrd_options .= " DEF:".$id."max=$filename:$rra:MAX";
- $rrd_options .= " LINE1.25:".$id."#".$colour.":'$descr'";
+ if($rrd['invert'] == "1") {
+ $rrd_options .= " CDEF:".$id."graph=".$id.",-1,*";
+ $rrd_options .= " LINE1.25:".$id."graph#".$colour.":'$descr'";
+ } else {
+ $rrd_options .= " LINE1.25:".$id."#".$colour.":'$descr'";
+ }
+
$rrd_options .= " GPRINT:".$id.":LAST:%5.2lf%s GPRINT:".$id."min:MIN:%5.2lf%s";
$rrd_options .= " GPRINT:".$id."max:MAX:%5.2lf%s GPRINT:".$id.":AVERAGE:%5.2lf%s\\\\n";