uint32_t color;
_Bool stack;
_Bool area;
+ char *format;
graph_def_t *next;
};
}
memset (ret, 0, sizeof (*ret));
ret->legend = NULL;
+ ret->format = NULL;
ret->ds_name = strdup (ds_name);
if (ret->ds_name == NULL)
ident_destroy (def->select);
free (def->ds_name);
+ free (def->legend);
+ free (def->format);
free (def);
graph_config_get_bool (child, &def->stack);
else if (strcasecmp ("Area", child->key) == 0)
graph_config_get_bool (child, &def->area);
+ else if (strcasecmp ("Format", child->key) == 0)
+ graph_config_get_string (child, &def->format);
else
fprintf (stderr, "def_config: Ignoring unknown config option \"%s\"",
child->key);
index, def->color,
(def->legend != NULL) ? def->legend : def->ds_name,
def->stack ? ":STACK" : "");
- array_append_format (args, "GPRINT:vdef_%04i_min:%%lg min,", index);
- array_append_format (args, "GPRINT:vdef_%04i_avg:%%lg avg,", index);
- array_append_format (args, "GPRINT:vdef_%04i_max:%%lg max,", index);
- array_append_format (args, "GPRINT:vdef_%04i_lst:%%lg last\\l", index);
+ array_append_format (args, "GPRINT:vdef_%04i_min:%s min,",
+ index, (def->format != NULL) ? def->format : "%lg");
+ array_append_format (args, "GPRINT:vdef_%04i_avg:%s avg,",
+ index, (def->format != NULL) ? def->format : "%lg");
+ array_append_format (args, "GPRINT:vdef_%04i_max:%s max,",
+ index, (def->format != NULL) ? def->format : "%lg");
+ array_append_format (args, "GPRINT:vdef_%04i_lst:%s last\\l",
+ index, (def->format != NULL) ? def->format : "%lg");
free (file);