projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added a nop control for string formating, so that strings ending in /x are possible...
[rrdtool.git]
/
src
/
rrd_graph.c
diff --git
a/src/rrd_graph.c
b/src/rrd_graph.c
index
d7781f6
..
8417291
100644
(file)
--- 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}
,
,
{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"}
,
{6 * 3600, 0, TMT_MONTH, 1, TMT_MONTH, 1, TMT_MONTH, 1, 30 * 24 * 3600,
"%b"}
@@
-413,8
+412,11
@@
void auto_scale(
}
}
}
}
+/* power prefixes */
static char si_symbol[] = {
static char si_symbol[] = {
+ 'y', /* 10e-24 Yocto */
+ 'z', /* 10e-21 Zepto */
'a', /* 10e-18 Atto */
'f', /* 10e-15 Femto */
'p', /* 10e-12 Pico */
'a', /* 10e-18 Atto */
'f', /* 10e-15 Femto */
'p', /* 10e-12 Pico */
@@
-428,8
+430,10
@@
static char si_symbol[] = {
'T', /* 10e12 Tera */
'P', /* 10e15 Peta */
'E', /* 10e18 Exa */
'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(
/* find SI magnitude symbol for the numbers on the y-axis*/
void si_unit(
@@
-896,11
+900,15
@@
int data_fetch(
&im->gdes[i].ds_cnt,
&im->gdes[i].ds_namv,
&im->gdes[i].data)) == -1) {
&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;
}
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,
if (ft_step < im->gdes[i].step) {
reduce_data(im->gdes[i].cf_reduce,
ft_step,
@@
-1782,6
+1790,7
@@
int leg_place(
prt_fctn != 'j' &&
prt_fctn != 'c' &&
prt_fctn != 'u' &&
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
prt_fctn != 's' && prt_fctn != '\0' && prt_fctn != 'g') {
free(legspace);
rrd_set_error
@@
-1793,6
+1802,10
@@
int leg_place(
if (prt_fctn == 'n') {
prt_fctn = 'l';
}
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' &&
/* remove exess space from the end of the legend for \g */
while (prt_fctn == 'g' &&
@@
-2939,6
+2952,7
@@
int graph_size_location(
im->ximg = im->xsize;
im->yimg = im->ysize;
im->yorigin = im->ysize;
im->ximg = im->xsize;
im->yimg = im->ysize;
im->yorigin = im->ysize;
+ xtr(im, 0);
ytr(im, DNAN);
return 0;
}
ytr(im, DNAN);
return 0;
}
@@
-4154,6
+4168,7
@@
void rrd_graph_init(
im->maxval = DNAN;
im->minval = 0;
im->minval = DNAN;
im->maxval = DNAN;
im->minval = 0;
im->minval = DNAN;
+ im->magfact = 1;
im->prt_c = 0;
im->rigid = 0;
im->rendered_image_size = 0;
im->prt_c = 0;
im->rigid = 0;
im->rendered_image_size = 0;