if (read_next_sample(ifd, IGNORE_RESTART | IGNORE_COMMENT, 0,
file, &rtype, 0, file_magic, file_actlst,
rectime, loctime))
- /* End of sa data file */
- return;
+ {
+ /* End of sa data file: No views displayed */
+ parm.graph_nr = 0;
+ goto close_svg;
+ }
}
while ((rtype == R_RESTART) || (rtype == R_COMMENT) ||
(tm_start.use && (datecmp(loctime, &tm_start) < 0)) ||
}
/* Real number of graphs that have been displayed */
- graph_nr = g_nr;
+ parm.graph_nr = g_nr;
+close_svg:
/* Print SVG trailer */
if (*fmt[f_position]->f_header) {
- (*fmt[f_position]->f_header)(&graph_nr, F_END, file, file_magic,
+ (*fmt[f_position]->f_header)(&parm, F_END, file, file_magic,
&file_hdr, cpu_nr, act, id_seq);
}
}
if (action & F_END) {
if (!(action & F_BEGIN)) {
+ if (!hdr_parm->graph_nr) {
+ /* No views displayed */
+ printf("<text x= \"0\" y=\"60\" text-anchor=\"start\" stroke=\"red\">");
+ printf("No data!</text>\n");
+ }
/* Give actual SVG height */
printf("<!-- Actual canvas height: %d -->\n",
SVG_H_YSIZE + SVG_T_YSIZE * (hdr_parm->graph_nr));