diff --git a/src/rrd_graph.c b/src/rrd_graph.c
index d7781f6dec454edd7b6b9d19a8784d6801c1713d..240e96f7cb48e673f61a51afd1ba2f8165190059 100644 (file)
--- a/src/rrd_graph.c
+++ b/src/rrd_graph.c
,
{3600, 0, TMT_DAY, 1, TMT_WEEK, 1, TMT_WEEK, 1, 7 * 24 * 3600, week_fmt}
,
- {3 * 3600, 0, TMT_WEEK, 1, TMT_MONTH, 1, TMT_WEEK, 2, 7 * 24 * 3600,
- week_fmt}
+ {3 * 3600, 0, TMT_WEEK, 1, TMT_MONTH, 1, TMT_WEEK, 2, 7 * 24 * 3600, week_fmt}
,
{6 * 3600, 0, TMT_MONTH, 1, TMT_MONTH, 1, TMT_MONTH, 1, 30 * 24 * 3600,
"%b"}
conv_if(SVG, IF_SVG);
conv_if(EPS, IF_EPS);
conv_if(PDF, IF_PDF);
+ conv_if(XML, IF_XML);
+ conv_if(CSV, IF_CSV);
+ conv_if(TSV, IF_TSV);
+ conv_if(SSV, IF_SSV);
+ conv_if(JSON, IF_JSON);
return (enum gfx_if_en)(-1);
}
}
}
+/* power prefixes */
static char si_symbol[] = {
+ 'y', /* 10e-24 Yocto */
+ 'z', /* 10e-21 Zepto */
'a', /* 10e-18 Atto */
'f', /* 10e-15 Femto */
'p', /* 10e-12 Pico */
'T', /* 10e12 Tera */
'P', /* 10e15 Peta */
'E', /* 10e18 Exa */
+ 'Z', /* 10e21 Zeta */
+ 'Y' /* 10e24 Yotta */
};
-static const int si_symbcenter = 6;
+static const int si_symbcenter = 8;
/* find SI magnitude symbol for the numbers on the y-axis*/
void si_unit(
&im->gdes[i].ds_cnt,
&im->gdes[i].ds_namv,
&im->gdes[i].data)) == -1) {
- return -1;
- }
+ return -1;
+ }
}
im->gdes[i].data_first = 1;
+ /* must reduce to at least im->step
+ otherwhise we end up with more data than we can handle in the
+ chart and visibility of data will be random */
+ im->gdes[i].step = max(im->gdes[i].step,im->step);
if (ft_step < im->gdes[i].step) {
reduce_data(im->gdes[i].cf_reduce,
ft_step,
prt_fctn != 'j' &&
prt_fctn != 'c' &&
prt_fctn != 'u' &&
+ prt_fctn != '.' &&
prt_fctn != 's' && prt_fctn != '\0' && prt_fctn != 'g') {
free(legspace);
rrd_set_error
if (prt_fctn == 'n') {
prt_fctn = 'l';
}
+ /* \. is a null operation to allow strings ending in \x */
+ if (prt_fctn == '.') {
+ prt_fctn = '\0';
+ }
/* remove exess space from the end of the legend for \g */
while (prt_fctn == 'g' &&
im->ximg = im->xsize;
im->yimg = im->ysize;
im->yorigin = im->ysize;
+ xtr(im, 0);
ytr(im, DNAN);
return 0;
}
cairo_svg_surface_restrict_to_version
(im->surface, CAIRO_SVG_VERSION_1_1);
break;
+ case IF_XML:
+ case IF_CSV:
+ case IF_TSV:
+ case IF_SSV:
+ case IF_JSON:
+ break;
};
cairo_destroy(im->cr);
im->cr = cairo_create(im->surface);
** - options parsing now in rrd_graph_options()
** - script parsing now in rrd_graph_script()
*/
+
+/* have no better idea where to put it - rrd.h does not work */
+int rrd_graph_xport(image_desc_t *);
+
rrd_info_t *rrd_graph_v(
int argc,
char **argv)
return NULL;
}
+ if (im.imgformat >= IF_XML) {
+ rrd_graph_xport(&im);
+ } else {
+
/* Everything is now read and the actual work can start */
if (graph_paint(&im) == -1) {
im_free(&im);
return NULL;
}
-
+ }
/* The image is generated and needs to be output.
** Also, if needed, print a line with information about the image.
im->maxval = DNAN;
im->minval = 0;
im->minval = DNAN;
+ im->magfact = 1;
im->prt_c = 0;
im->rigid = 0;
im->rendered_image_size = 0;