// Add a watermark
"--watermark=" PACKAGE_NAME,
- // Invert legend order. This way, we can draw graphs from back to front
- // to be able to user overlay and transparency.
- "--legend-direction=bottomup",
-
// Honour upper/lower limit
"--rigid",
}
}
+ // Invert the legend?
+ // This way, we can draw graphs from back to front
+ // to be able to user overlay and transparency.
+ if (self->impl->flags & COLLECTY_GRAPH_REVERSE) {
+ r = collecty_args_push(args, "--legend-direction=bottomup");
+ if (r < 0)
+ goto ERROR;
+ }
+
// Write the graph to the output stream
r = collecty_args_push(args, "-");
if (r < 0)
// Name
const char* name;
+ // Flags
+ enum {
+ COLLECTY_GRAPH_REVERSE = (1 << 0),
+ } flags;
+
// Limits
long lower_limit;
long upper_limit;
if (r < 0)
return r;
- // Limit
- DRAW_LINE1_WITH_LABEL(args, "max", LIMIT, _("Limit"), DASHES SKIPSCALE);
- PRINT_LARGE_INTEGER(args, "max_cur");
- PRINT_NOTHING(args);
- PRINT_NOTHING(args);
- PRINT_NOTHING(args, EOL);
+ // Header
+ PRINT_HEADER4(args, _("Current"), _("Average"), _("Minimum"), _("Maximum"));
// Entries
DRAW_AREA_WITH_LABEL(args, "count", GREEN, _("Entries"));
PRINT_LARGE_INTEGER(args, "count_min");
PRINT_LARGE_INTEGER(args, "count_max", EOL);
- // Header
- PRINT_HEADER4(args, _("Current"), _("Average"), _("Minimum"), _("Maximum"));
+ // Limit
+ DRAW_LINE1_WITH_LABEL(args, "max", LIMIT, _("Limit"), DASHES SKIPSCALE);
+ PRINT_LARGE_INTEGER(args, "max_cur");
+ PRINT_NOTHING(args);
+ PRINT_NOTHING(args);
+ PRINT_NOTHING(args, EOL);
return 0;
}
if (r < 0)
return r;
+ // Header
+ PRINT_HEADER4(args, _("Current"), _("Average"), _("Minimum"), _("Maximum"));
+
// Context Switches
DRAW_AREA_WITH_LABEL(args, "ctxt", GREEN, _("Context Switches"));
PRINT_LARGE_INTEGER(args, "ctxt_cur");
PRINT_LARGE_INTEGER(args, "ctxt_min");
PRINT_LARGE_INTEGER(args, "ctxt_max", EOL);
- // Header
- PRINT_HEADER4(args, _("Current"), _("Average"), _("Minimum"), _("Maximum"));
-
return 0;
}
.title = loadavg_title,
.vlabel = loadavg_title,
+ // Flags
+ .flags = COLLECTY_GRAPH_REVERSE,
+
// Limits
.lower_limit = 0,
.upper_limit = LONG_MAX,