summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a5e4fd8)
raw | patch | inline | side by side (parent: a5e4fd8)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 9 May 2005 19:32:12 +0000 (19:32 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 9 May 2005 19:32:12 +0000 (19:32 +0000) |
program/src/rrd_graph.c | patch | blob | history |
index 2fae2583de02cfda0e96f5edeafac79a4dbfc292..b53672fa05a4cb42c6fdfadb01bbd537c3278121 100644 (file)
--- a/program/src/rrd_graph.c
+++ b/program/src/rrd_graph.c
int sgrid = (int)( im->minval / im->ygrid_scale.gridstep - 1);
int egrid = (int)( im->maxval / im->ygrid_scale.gridstep + 1);
+ double MaxY;
scaledstep = im->ygrid_scale.gridstep/im->magfact;
+ MaxY = scaledstep*(double)im->viewfactor*(double)egrid;
for (i = sgrid; i <= egrid; i++){
double Y0=ytr(im,im->ygrid_scale.gridstep*i);
if ( Y0 >= im->yorigin-im->ysize
&& Y0 <= im->yorigin){
if(i % im->ygrid_scale.labfact == 0){
if (i==0 || im->symbol == ' ') {
- if(scaledstep < 1){
+ if(MaxY < 10) {
if(im->extra_flags & ALTYGRID) {
sprintf(graph_label,im->ygrid_scale.labfmt,scaledstep*im->viewfactor*i);
}
sprintf(graph_label,"%4.0f",scaledstep*im->viewfactor*i);
}
}else {
- if(scaledstep < 1){
+ if(MaxY < 10){
sprintf(graph_label,"%4.1f %c",scaledstep*im->viewfactor*i, im->symbol);
} else {
sprintf(graph_label,"%4.0f %c",scaledstep*im->viewfactor*i, im->symbol);