rrdtool-1.x
rrdtool-1.x copied to clipboard
Y-axis scaling issue for graphs with limited data variation
I have been dealing with this problem for several years, but finally today upgraded to 1.6.0. I was hoping the problem might be fixed, but I'm still experiencing it. The Y-axis is completely blank ... there are no values on it at all. It's really inconvenient, and I have plenty of people asking me about it all the time. I understand there are some things I could do (--alt-autoscale for one) to fix this, but I'm very happy with the presentation of the data at this precise scale - I just need some data to go along with it!
Here is an example of the graph:
Here is the command used to generate the graph (different timespan):
/usr/local/rrdtool-1.6.0/bin/rrdtool graph -
--imgformat=PNG
--start='1489284540'
--end='1489367340'
--pango-markup
--title='HPCF - Power Usage Effectiveness (PUE)'
--vertical-label='Total / IT Load'
--slope-mode
--base=1000
--height=120
--width=500
--tabwidth '30'
--alt-autoscale
COMMENT:"From 2017/03/11 19:09:00 To 2017/03/12 19:09:00\c"
COMMENT:" \n"
--color BACK#F3F3F3
--color CANVAS#FDFDFD
--color SHADEA#CBCBCB
--color SHADEB#999999
--color FONT#000000
--color AXIS#2C4D43
--color ARROW#2C4D43
--color FRAME#2C4D43
--border 1 --font TITLE:10:
--font AXIS:8:
--font LEGEND:8:
--font UNIT:8:
--font WATERMARK:8:
--slope-mode
DEF:a='/cacti/cacti-1.0.4-prod/rra/hpcf_pue_28240.rrd':'pue':AVERAGE
DEF:b='/cacti/cacti-1.0.4-prod/rra/hpcf_pue_28240.rrd':'pue':MAX
LINE1:a#4444FFFF:'AVG PUE'
GPRINT:a:LAST:'Current:%8.4lf %s'
GPRINT:a:MIN:'Min:%8.4lf %s'
GPRINT:a:AVERAGE:'Avg:%8.4lf %s'
GPRINT:a:MAX:'Max:%8.4lf %s\n'
LINE1:b#FF4105FF:'MAX PUE'
GPRINT:b:MAX:'Maximum:%8.4lf %s\n'
AREA:a#4444FF99:""
COMMENT:' \n' \
from the documentation
[-A|--alt-autoscale]
Sometimes the default algorithm for selecting the y-axis scale is not satisfactory. Normally the scale is selected from a predefined set of ranges and this fails miserably when you need to graph something like 260 + 0.001 * sin(x). This option calculates the minimum and maximum y-axis from the actual minimum and maximum data values. Our example would display slightly less than 260-0.001 to slightly more than 260+0.001 (this feature was contributed by Sasha Mikheev).
[-Y|--alt-y-grid]
Place the Y grid dynamically based on the graph's Y range. The algorithm ensures that you always have a grid, that there are enough but not too many grid lines, and that the grid is metric. That is the grid lines are placed every 1, 2, 5 or 10 units. This parameter will also ensure that you get enough decimals displayed even if your graph goes from 69.998 to 70.001. (contributed by Sasha Mikheev).
if you have other, more generic scaling or labeling ideas, by all means, provide a PR!.
I'm having some better luck with --alt-y-grid than I did the last time I tried it. I think using rrdtool 1.6 instead of 1.4 is probably helping the situation this time, but I could be wrong. In some cases I'm still only getting 2 y axis values, where I feel I should be getting at least 4 due to the size of the graph. See here:
Any ideas, or is it on me to submit a patch for this? ;)
yes I have given some love to this function for 1.6 ... and yes ... providing patches is certainly a good thing ... you can also hire us ...
You get the same problem than mine https://github.com/oetiker/rrdtool-1.x/issues/753