diff --git a/html/includes/graphs/device/collectd.inc.php b/html/includes/graphs/device/collectd.inc.php
index f524691da..4a99662ab 100755
--- a/html/includes/graphs/device/collectd.inc.php
+++ b/html/includes/graphs/device/collectd.inc.php
@@ -204,6 +204,13 @@ if(isset($rrd_cmd))
$rrd_cmd .= " -s " . $from . " -e " . $to;
}
+if ($_GET['legend'] == "no" || $_GET['legend'] == 0) { $rrd_cmd .= " -g "; }
+
+if ($height < "99") { $rrd_cmd .= " --only-graph "; }
+if ($width <= "300") { $rrd_cmd .= " --font LEGEND:7:" . $config['mono_font'] . " --font AXIS:6:" . $config['mono_font'] . " "; }
+else { $rrd_cmd .= " --font LEGEND:8:" . $config['mono_font'] . " --font AXIS:7:" . $config['mono_font'] . " "; }
+
+
if (isset($_GET['debug'])) {
header('Content-Type: text/plain; charset=utf-8');
printf("Would have executed:\n%s\n", $rrd_cmd);
diff --git a/html/pages/graphs.inc.php b/html/pages/graphs.inc.php
index 351627540..efb70dfc0 100644
--- a/html/pages/graphs.inc.php
+++ b/html/pages/graphs.inc.php
@@ -33,12 +33,11 @@ if (!$auth)
} else {
if (isset($config['graph_types'][$type][$subtype]['descr'])) { $title .= " :: ".$config['graph_types'][$type][$subtype]['descr']; } else { $title .= " :: ".$graph_type; }
+ $graph_array = $vars;
$graph_array['height'] = "60";
$graph_array['width'] = $thumb_width;
- $graph_array['legend'] = "no";
+ $graph_array['legend'] = 0;
$graph_array['to'] = $now;
- $graph_array['id'] = $vars['id'];
- $graph_array['type'] = $vars['type'];
print_optionbar_start();
echo($title);