X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_graph.c;h=aba5b6f70493cf288c8ae181e86089c4cbf50ee4;hb=d85e6bdfe82fdc4d16898df43f8a5371503816ae;hp=3f8ee1bff143af2dc004eb0e83ffaac4200b8e9f;hpb=0993ad690db2a221cfbcb9b908dc80d950a802f9;p=rrdtool.git diff --git a/src/rrd_graph.c b/src/rrd_graph.c index 3f8ee1b..aba5b6f 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -91,8 +91,7 @@ xlab_t xlab[] = { , {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"} @@ -257,6 +256,13 @@ enum gfx_if_en if_conv( conv_if(SVG, IF_SVG); conv_if(EPS, IF_EPS); conv_if(PDF, IF_PDF); + conv_if(XML, IF_XML); + conv_if(XMLENUM, IF_XMLENUM); + conv_if(CSV, IF_CSV); + conv_if(TSV, IF_TSV); + conv_if(SSV, IF_SSV); + conv_if(JSON, IF_JSON); + conv_if(JSONTIME, IF_JSONTIME); return (enum gfx_if_en)(-1); } @@ -413,8 +419,11 @@ void auto_scale( } } +/* 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 */ @@ -428,8 +437,10 @@ static char si_symbol[] = { '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( @@ -1786,6 +1797,7 @@ int leg_place( 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 @@ -1797,6 +1809,10 @@ int leg_place( 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' && @@ -2943,6 +2959,7 @@ int graph_size_location( im->ximg = im->xsize; im->yimg = im->ysize; im->yorigin = im->ysize; + xtr(im, 0); ytr(im, DNAN); return 0; } @@ -3395,6 +3412,14 @@ int graph_paint( cairo_svg_surface_restrict_to_version (im->surface, CAIRO_SVG_VERSION_1_1); break; + case IF_XML: + case IF_XMLENUM: + case IF_CSV: + case IF_TSV: + case IF_SSV: + case IF_JSON: + case IF_JSONTIME: + break; }; cairo_destroy(im->cr); im->cr = cairo_create(im->surface); @@ -4007,6 +4032,10 @@ int rrd_graph( ** - 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) @@ -4058,6 +4087,10 @@ rrd_info_t *rrd_graph_v( 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) { @@ -4065,7 +4098,7 @@ rrd_info_t *rrd_graph_v( 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. @@ -4158,6 +4191,7 @@ void rrd_graph_init( im->maxval = DNAN; im->minval = 0; im->minval = DNAN; + im->magfact = 1; im->prt_c = 0; im->rigid = 0; im->rendered_image_size = 0;