From: Sebastien GODARD Date: Mon, 9 Jul 2018 13:35:47 +0000 (+0200) Subject: sadf: SVG: Don't display "No data" over the table of contents X-Git-Tag: v12.0.0~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ba2ed566903fa229ce3f25d56a130398db8ebb47;p=sysstat sadf: SVG: Don't display "No data" over the table of contents 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 --- diff --git a/sadf_misc.c b/sadf_misc.c index e8ab8df..cea1cf8 100644 --- a/sadf_misc.c +++ b/sadf_misc.c @@ -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(""); + printf("", + SVG_H_YSIZE + + SVG_C_YSIZE * (DISPLAY_TOC(flags) ? hdr_parm->nr_act_dispd : 0)); printf("No data!\n"); } /* Give actual SVG height */