]> granicus.if.org Git - sysstat/commitdiff
sadf: SVG: Don't display "No data" over the table of contents
authorSebastien GODARD <sysstat@users.noreply.github.com>
Mon, 9 Jul 2018 13:35:47 +0000 (15:35 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Mon, 9 Jul 2018 13:35:47 +0000 (15:35 +0200)
Sometimes, when all the selected activities have only zero values and
the skipempty option has been used with "sadf -g", the "No data" message
is displayed instead of the graphs.
In these conditions make sure that it doesn't get printed over the table
of contents entries.
Here is how to reproduce the problem on my system (I don't have any
network filesystems):

$ sadf -g -O showtoc,skipempty -- -n NFS,NFSD > output.svg

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

index e8ab8dfd402e879c60556d237f568de400511a03..cea1cf8e40aac1ca251d2eab2e58f78aa5985864 100644 (file)
@@ -985,7 +985,9 @@ __printf_funct_t print_svg_header(void *parm, int action, char *dfile,
                if (!(action & F_BEGIN)) {
                        if (!hdr_parm->graph_nr) {
                                /* No views displayed */
-                               printf("<text x= \"0\" y=\"60\" text-anchor=\"start\" stroke=\"red\">");
+                               printf("<text x= \"0\" y=\"%d\" text-anchor=\"start\" stroke=\"red\">",
+                                      SVG_H_YSIZE +
+                                      SVG_C_YSIZE * (DISPLAY_TOC(flags) ? hdr_parm->nr_act_dispd : 0));
                                printf("No data!</text>\n");
                        }
                        /* Give actual SVG height */