Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-03-20 11:52:06 +0100
committerErich Eckner <git@eckner.net>2018-03-20 11:52:06 +0100
commite955c7d36c794056fd777398ac37c466cde8ddc3 (patch)
tree613ccb8c3d3e753b88c58433c3fb44c0ff3f561e
parent85201f7de2d131aba3c4e10852aed3e11f39fa0a (diff)
web-scripts/statistics.php: make legend nice(r) again
-rw-r--r--web-scripts/statistics.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/web-scripts/statistics.php b/web-scripts/statistics.php
index 1e4d89b..41b205f 100644
--- a/web-scripts/statistics.php
+++ b/web-scripts/statistics.php
@@ -51,7 +51,7 @@ $width = 1600;
$height = 600;
$border = 5;
$legend_line_length = 10;
-$legend_height = 3 * ImageFontHeight(5) + $legend_line_length;
+$legend_height = 4 * ImageFontHeight(5) + $legend_line_length;
$im = @ImageCreate ($width + $legend_line_length + $max_len * ImageFontWidth(5), $height + $legend_height)
or die ("Cannot create new gd-image-stream");
@@ -118,13 +118,13 @@ function print_graph($data, $color) {
ImageRectangle($im, $legend_line_length, 0, $width-1+$legend_line_length, $height-1, $foreground_color);
-ImageString($im, 5, $legend_line_length, $height + $legend_line_length + 2*ImageFontHeight(5), "( ".trim(shell_exec("uptime | sed 's|^.*\\s\\(load\\)|\\1|'"))." )", $foreground_color);
+ImageString($im, 5, $legend_line_length, $height + 2*$legend_line_length + 2*ImageFontHeight(5), "( ".trim(shell_exec("uptime | sed 's|^.*\\s\\(load\\)|\\1|'"))." )", $foreground_color);
$xpos = $legend_line_length;
foreach ($print_columns as $column) {
print_graph($values[$column], $colors[$column]);
- ImageString($im, 5, $xpos, $height + $legend_line_length + ImageFontHeight(5), $column, $colors[$column]);
- $xpos += (strlen($column) + 1.75) * ImageFontWidth(5);
+ ImageString($im, 5, $xpos, $height + $legend_line_length + ImageFontHeight(5), substr($column,0,-strlen("_count")), $colors[$column]);
+ $xpos += (strlen($column) - strlen("_count") + 1.75) * ImageFontWidth(5);
}
ImageString($im, 5, $legend_line_length, $height + $legend_line_length, date('Y-m-d H:i', $t_min), $foreground_color);