#include <rrd.h>
#include "args.h"
+#include "colors.h"
#include "ctx.h"
#include "daemon.h"
#include "graph.h"
const collecty_graph_impl* impl;
};
+const char* DEFAULT_RENDER_ARGS[] = {
+ // Change the background color
+ "--color=BACK" COLOR_BLACK,
+
+ // Disable the border around the image
+ "--border=0",
+
+ // Let's width and heigh define the size of the entire image
+ "--full-size-mode",
+
+ // Give the curves a more organic look
+ "--slope-mode",
+
+ // Show nicer labels
+ "--dynamic-labels",
+
+ // Add a watermark
+ "--watermark=PACKAGE_NAME",
+
+ // Sentinel
+ NULL,
+};
+
static void collecty_graph_free(collecty_graph* self) {
if (self->daemon)
collecty_daemon_unref(self->daemon);
if (r < 0)
goto ERROR;
+ // Push the default arguments
+ r = collecty_args_pushv(args, DEFAULT_RENDER_ARGS);
+ if (r < 0)
+ goto ERROR;
+
// Call the implementation to add some arguments
r = self->impl->render(self->ctx, self, args, object);
if (r < 0)