You can specify the format of the x-axis labels using the --x-grid
option.
The parameters specify all the properties of the x-grid including the labels and their positioning. You can not have a multi-line label, but you can use full strftime formatting to specify a label of your choice.
Normally rrdtool will pick something 'sensible' automatically but you can specify your own rule if you want:
[-x|--x-grid GTM:GST:MTM:MST:LTM:LST:LPR:LFM]
The grid is defined by specifying a certain amount of time in the ?TM
positions. You can choose from SECOND
, MINUTE
, HOUR
, DAY
, WEEK
, MONTH
or YEAR
. Then you define how many of these should pass between each line or label. This pair (?TM:?ST)
needs to be specified for the base grid (G??)
, the major grid (M??)
and the labels (L??)
. For the labels you also must define a precision in LPR
and a strftime format string in LFM
. LPR
defines where each label will be placed. If it is zero, the label will be placed right under the corresponding line (useful for hours, dates etcetera). If you specify a number of seconds here the label is centered on this interval (useful for Monday, January etcetera).
--x-grid MINUTE:10:HOUR:1:HOUR:4:0:%X
This places grid lines every 10 minutes, major grid lines every hour, and labels every 4 hours. The labels are placed under the major grid lines as they specify exactly that time.
--x-grid HOUR:8:DAY:1:DAY:1:86400:%A
This places grid lines every 8 hours, major grid lines and labels each day. The labels are placed exactly between two major grid lines as they specify the complete day and not just midnight.
A strftime format to show weekday and date would be %a %D
Also note that with rrdtool 1.5.x the automatic labeling code has been re-done ... and produces more sensible results.