[B<-u>|B<--upper-limit> I<value>]
[B<-l>|B<--lower-limit> I<value>]
[B<-r>|B<--rigid>]
+[B<--allow-shrink>]
By default the graph will be autoscaling so that it will adjust the
y-axis to the range of the data. You can change this behavior by
explicitly setting the limits. The displayed y-axis will then range at
least from B<lower-limit> to B<upper-limit>. Autoscaling will still
permit those boundaries to be stretched unless the B<rigid> option is
-set.
+set. B<allow-shrink> alters behaivor of B<rigid> by allowing auto down scale,
+graph will not overrun user specified limits.
[B<-A>|B<--alt-autoscale>]
im->minval = minval;
}
if (isnan(im->maxval)
- || (!im->rigid && im->maxval < maxval)
+ || ((!im->rigid) && im->maxval < maxval)
+ ) {
+ if (im->logarithmic)
+ im->maxval = maxval * 2.0;
+ else
+ im->maxval = maxval;
+ }
+
+ if (!isnan(im->minval)
+ && (im->rigid && im->allow_shrink && im->minval < minval)
+ ) {
+ if (im->logarithmic)
+ im->minval = minval / 2.0;
+ else
+ im->minval = minval;
+ }
+ if (!isnan(im->maxval)
+ && (im->rigid && im->allow_shrink && im->maxval > maxval)
) {
if (im->logarithmic)
im->maxval = maxval * 2.0;
im->maxval = 1.0;
}
}
+
return 0;
}
/* get actual drawing data and find min and max values */
if (data_proc(im) == -1)
return -1;
+
+ /* identify si magnitude Kilo, Mega Giga ? */
if (!im->logarithmic) {
si_unit(im);
}
- /* identify si magnitude Kilo, Mega Giga ? */
- if (!im->rigid && !im->logarithmic)
- expand_range(im); /* make sure the upper and lower limit are
- sensible values */
+ /* make sure the upper and lower limit are sensible values
+ if rigid is without alow_shrink skip expanding limits */
+ if ((!im->rigid || im->allow_shrink) && !im->logarithmic)
+ expand_range(im);
info.u_val = im->minval;
grinfo_push(im, sprintf_alloc("value_min"), RD_I_VAL, info);
im->magfact = 1;
im->prt_c = 0;
im->rigid = 0;
+ im->allow_shrink = 0;
im->rendered_image_size = 0;
im->rendered_image = NULL;
im->slopemode = 0;
{"left-axis-format", 1012, OPTPARSE_REQUIRED},
{"left-axis-formatter",1013, OPTPARSE_REQUIRED},
{"right-axis-formatter",1014, OPTPARSE_REQUIRED},
+ {"allow-shrink", 1015, OPTPARSE_NONE},
{0}
};
/* *INDENT-ON* */
case 'r':
im->rigid = 1;
break;
+ case 1015:
+ im->allow_shrink = 1;
+ break;
case 'f':
im->imginfo = (char *)poptions->optarg;
break;
rrd_value_t minval, maxval; /* extreme values in the data */
int rigid; /* do not expand range even with
values outside */
+ int allow_shrink; /* less "rigid" --rigid */
ygrid_scale_t ygrid_scale; /* calculated y axis grid info */
int gridfit; /* adjust y-axis range etc so all
grindlines falls in integer pixel values */