]> granicus.if.org Git - sysstat/commitdiff
sadf: SVG: Don't insert a gap in SVG output if an activity is not
authorSebastien GODARD <sysstat@users.noreply.github.com>
Fri, 6 Jul 2018 13:31:48 +0000 (15:31 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Fri, 6 Jul 2018 13:31:48 +0000 (15:31 +0200)
displayed

In "packed" mode, we have to make sure that at least one graph for
current activity has been displayed before moving to next row.
Without this patch problem could happen with a command like:

$ sadf -g -O packed,skipempty -- -A > output.svg

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
svg_stats.c

index 546a792d91f30d68e990c58d78f76e645a582202..bca06073c3a6adb1ea09b0e160ce41c16c205b53 100644 (file)
@@ -1060,10 +1060,10 @@ int draw_activity_graphs(int g_nr, int g_type[], char *title[], char *g_title[],
        }
        if (displayed) {
                printf("</g>\n");
-       }
 
-       /* For next row of views */
-       (svg_p->graph_no) += PACK_VIEWS(flags) ? 1 : views_nr;
+               /* For next row of views */
+               (svg_p->graph_no) += PACK_VIEWS(flags) ? 1 : views_nr;
+       }
 
        return displayed;
 }