X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_graph.c;h=8417291bc2f05a5691cc44a906215e609cccc81a;hb=ba6b7d80dacb05a4c797d10d845fcfad919f661f;hp=50a640a7edea604f63c4a98db69399b143ccf256;hpb=ed3ee7c81e23fcd41693bc372470945576ae54d1;p=rrdtool.git diff --git a/src/rrd_graph.c b/src/rrd_graph.c index 50a640a..8417291 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -412,8 +412,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 */ @@ -427,8 +430,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( @@ -1785,6 +1790,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 @@ -1796,6 +1802,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' &&