1RRDGRAPH_GRAPH(1) rrdtool RRDGRAPH_GRAPH(1)
2
3
4
6 rrdgraph_graph - rrdtool graph command reference
7
9 PRINT:vname:format
10
11 GPRINT:vname:format
12
13 COMMENT:text
14
15 VRULE:time#color[:legend][:dashes[=on_s[,off_s[,on_s,off_s]...]][:dash-offset=offset]]
16
17 HRULE:value#color[:legend][:dashes[=on_s[,off_s[,on_s,off_s]...]][:dash-offset=offset]]
18
19 LINE[width]:value[#color][:[legend][:STACK][:skipscale][:dashes[=on_s[,off_s[,on_s,off_s]...]][:dash-offset=offset]]
20
21 AREA:value[#color][:[legend][:STACK][:skipscale]]
22
23 TICK:vname#rrggbb[aa][:fraction[:legend]]
24
25 SHIFT:vname:offset
26
27 TEXTALIGN:{left|right|justified|center}
28
29 PRINT:vname:CF:format (deprecated)
30
31 GPRINT:vname:CF:format (deprecated)
32
33 STACK:vname#color[:legend] (deprecated)
34
36 These instructions allow you to generate your image or report. If you
37 don't use any graph elements, no graph is generated. Similarly, no
38 report is generated if you don't use print options.
39
40 PRINT
41 PRINT:vname:format[:strftime]
42
43 Depending on the context, either the value component or the time
44 component of a VDEF is printed using format. It is an error to specify
45 a vname generated by a DEF or CDEF.
46
47 Any text in format is printed literally with one exception: The percent
48 character introduces a formatter string. This string can be:
49
50 For printing values:
51
52 %% just prints a literal '%' character
53
54 %#.#le
55 prints numbers like 1.2346e+04. The optional integers # denote
56 field width and decimal precision.
57
58 %#.#lf
59 prints numbers like 12345.6789, with optional field width and
60 precision.
61
62 %s place this after %le, %lf or %lg. This will be replaced by the
63 appropriate SI magnitude unit and the value will be scaled
64 accordingly (123456 -> 123.456 k).
65
66 %S is similar to %s. It does, however, use a previously defined
67 magnitude unit. If there is no such unit yet, it tries to define
68 one (just like %s) unless the value is zero, in which case the
69 magnitude unit stays undefined. Thus, formatter strings using %S
70 and no %s will all use the same magnitude unit except for zero
71 values.
72
73 If you PRINT a VDEF value, you can also print the time associated with
74 it by appending the string :strftime to the format. Note that RRDtool
75 uses the strftime function of your OSs C library. This means that the
76 conversion specifier may vary. Check the manual page if you are
77 uncertain. The following is a list of conversion specifiers usually
78 supported across the board.
79
80 %a The abbreviated weekday name according to the current locale.
81
82 %A The full weekday name according to the current locale.
83
84 %b The abbreviated month name according to the current locale.
85
86 %B The full month name according to the current locale.
87
88 %c The preferred date and time representation for the current locale.
89
90 %d The day of the month as a decimal number (range 01 to 31).
91
92 %H The hour as a decimal number using a 24-hour clock (range 00 to
93 23).
94
95 %I The hour as a decimal number using a 12-hour clock (range 01 to
96 12).
97
98 %j The day of the year as a decimal number (range 001 to 366).
99
100 %m The month as a decimal number (range 01 to 12).
101
102 %M The minute as a decimal number (range 00 to 59).
103
104 %p Either `AM' or `PM' according to the given time value, or the
105 corresponding strings for the current locale. Noon is treated as
106 `pm' and midnight as `am'. Note that in many locales and `pm'
107 notation is unsupported and in such cases %p will return an empty
108 string.
109
110 %s The second as a decimal number (range 00 to 61).
111
112 %S The seconds since the epoch (1.1.1970) (libc dependent non
113 standard!)
114
115 %U The week number of the current year as a decimal number, range
116 00 to 53, starting with the first Sunday as the first day of week
117 01. See also %V and %W.
118
119 %V The ISO 8601:1988 week number of the current year as a decimal
120 number, range 01 to 53, where week 1 is the first week that has
121 at least 4 days in the current year, and with Monday as the first
122 day of the week. See also %U and %W.
123
124 %w The day of the week as a decimal, range 0 to 6, Sunday being 0.
125 See also %u.
126
127 %W The week number of the current year as a decimal number, range 00
128 to 53, starting with the first Monday as the first day of week
129 01.
130
131 %x The preferred date representation for the current locale without
132 the time.
133
134 %X The preferred time representation for the current locale without
135 the date.
136
137 %y The year as a decimal number without a century (range 00 to 99).
138
139 %Y The year as a decimal number including the century.
140
141 %Z The time zone or name or abbreviation.
142
143 %% A literal `%' character.
144
145 PRINT:vname:CF:format
146
147 Deprecated. Use the new form of this command in new scripts. The first
148 form of this command is to be used with CDEF vnames.
149
150 GRAPH
151 GPRINT:vname:format
152
153 This is the same as "PRINT", but printed inside the graph.
154
155 GPRINT:vname:CF:format
156
157 Deprecated. Use the new form of this command in new scripts. This is
158 the same as "PRINT", but printed inside the graph.
159
160 COMMENT:text
161
162 Text is printed literally in the legend section of the graph. Note that
163 in RRDtool 1.2 you have to escape colons in COMMENT text in the same
164 way you have to escape them in *PRINT commands by writing '\:'.
165
166 VRULE:time#color[:legend][:dashes[=on_s[,off_s[,on_s,off_s]...]][:dash-offset=offset]]
167
168 Draw a vertical line at time. Its color is composed from three
169 hexadecimal numbers specifying the rgb color components (00 is off, FF
170 is maximum) red, green and blue followed by an optional alpha.
171 Optionally, a legend box and string is printed in the legend section.
172 time may be a number or a variable from a VDEF. It is an error to use
173 vnames from DEF or CDEF here. Dashed lines can be drawn using the
174 dashes modifier. See LINE for more details.
175
176 HRULE:value#color[:legend][:dashes[=on_s[,off_s[,on_s,off_s]...]][:dash-offset=offset]]
177
178 Draw a horizontal line at value. HRULE acts much like LINE except that
179 will have no effect on the scale of the graph. If a HRULE is outside
180 the graphing area it will just not be visible.
181
182 LINE[width]:value[#color][:[legend][:STACK][:skipscale]][:dashes[=on_s[,off_s[,on_s,off_s]...]][:dash-offset=offset]]
183
184 Draw a line of the specified width onto the graph. width can be a
185 floating point number. If the color is not specified, the drawing is
186 done 'invisibly'. This is useful when stacking something else on top of
187 this line. Also optional is the legend box and string which will be
188 printed in the legend section if specified. The value can be generated
189 by DEF, VDEF, and CDEF. If the optional STACK modifier is used, this
190 line is stacked on top of the previous element which can be a LINE or
191 an AREA.
192
193 Normally the graphing function makes sure that the entire LINE or AREA
194 is visible in the chart. The scaling of the chart will be modified
195 accordingly if necessary. Any LINE or AREA can be excluded from this
196 process by adding the option skipscale.
197
198 The dashes modifier enables dashed line style. Without any further
199 options a symmetric dashed line with a segment length of 5 pixels will
200 be drawn. The dash pattern can be changed if the dashes= parameter is
201 followed by either one value or an even number (1, 2, 4, 6, ...) of
202 positive values. Each value provides the length of alternate on_s and
203 off_s portions of the stroke. The dash-offset parameter specifies an
204 offset into the pattern at which the stroke begins.
205
206 When you do not specify a color, you cannot specify a legend. Should
207 you want to use STACK, use the "LINEx:<value>::STACK" form.
208
209 AREA:value[#color][:[legend][:STACK][:skipscale]]
210
211 See LINE, however the area between the x-axis and the line will be
212 filled.
213
214 TICK:vname#rrggbb[aa][:fraction[:legend]]
215
216 Plot a tick mark (a vertical line) for each value of vname that is non-
217 zero and not *UNKNOWN*. The fraction argument specifies the length of
218 the tick mark as a fraction of the y-axis; the default value is 0.1
219 (10% of the axis). Note that the color specification is not optional.
220 The TICK marks normally start at the lower edge of the graphing area.
221 If the fraction is negative they start at the upper border of the
222 graphing area.
223
224 SHIFT:vname:offset
225
226 Using this command RRDtool will graph the following elements with the
227 specified offset. For instance, you can specify an offset of
228 ( 7*24*60*60 = ) 604'800 seconds to "look back" one week. Make sure to
229 tell the viewer of your graph you did this ... As with the other
230 graphing elements, you can specify a number or a variable here.
231
232 TEXTALIGN:{left|right|justified|center}
233
234 Labels are placed below the graph. When they overflow to the left, they
235 wrap to the next line. By default, lines are justified left and right.
236 The TEXTALIGN function lets you change this default. This is a command
237 and not an option, so that you can change the default several times in
238 your argument list.
239
240 STACK:vname#color[:legend]
241
242 Deprecated. Use the STACK modifiers on the other commands instead!
243
244 Some notes on stacking
245
246 When stacking, an element is not placed above the X-axis but rather on
247 top of the previous element. There must be something to stack upon.
248
249 You can use an invisible LINE or AREA to stacked upon.
250
251 An unknown value makes the entire stack unknown from that moment on.
252 You don't know where to begin (the unknown value) and therefore do not
253 know where to end.
254
255 If you want to make sure you will be displaying a certain variable,
256 make sure never to stack upon the unknown value. Use a CDEF
257 instruction with IF and UN to do so.
258
260 Escaping the colon
261 A colon ':' in a legend argument will mark the end of the legend. To
262 enter a ':' as part of a legend, the colon must be escaped with a
263 backslash '\:'. Beware that many environments process backslashes
264 themselves, so it may be necessary to write two backslashes in order to
265 one being passed onto rrd_graph.
266
267 String Formatting
268 The text printed below the actual graph can be formatted by appending
269 special escape characters at the end of a text. When ever such a
270 character occurs, all pending text is pushed onto the graph according
271 to the character specified.
272
273 Valid markers are: \j for justified, \l for left aligned, \r for right
274 aligned, and \c for centered. In the next section there is an example
275 showing how to use centered formatting.
276
277 \n is a valid alias for \l since incomplete parsing in earlier versions
278 of RRDtool lead to this behavior and a number of people has been using
279 it.
280
281 Normally there are two space characters inserted between every two
282 items printed into the graph. The space following a string can be
283 suppressed by putting a \g at the end of the string. The \g also
284 ignores any space inside the string if it is at the very end of the
285 string. This can be used in connection with %s to suppress empty unit
286 strings.
287
288 GPRINT:a:MAX:%lf%s\g
289
290 A special case is COMMENT:\s which inserts some additional vertical
291 space before placing the next row of legends.
292
293 If you want to have left and right aligned legends on the same line use
294 COMMENT:\u to go one line back like this:
295
296 COMMENT:left\l
297 COMMENT:\u
298 COMMENT:right\r
299
300 There is also a 'nop' control for situations where you want a string to
301 actually end in a backslash character sequence \.
302
303 COMMENT:OS\2\.
304
305 When using a proportional font in your graph, the tab characters or the
306 sequence \t will line-up legend elements. Note that the tabs inserted
307 are relative to the start of the current legend element!
308
309 Since RRDtool 1.3 is using Pango for rending text, you can use Pango
310 markup. Pango uses the xml span tags for inline formatting
311 instructions.:
312
313 A simple example of a marked-up string might be:
314
315 <span foreground="blue" size="x-large">Blue text</span> is <i>cool</i>!
316
317 The complete list of attributes for the span tag (taken from the pango
318 documentation):
319
320 font_desc
321 A font description string, such as "Sans Italic 12"; note that any
322 other span attributes will override this description. So if you
323 have "Sans Italic" and also a style="normal" attribute, you will
324 get Sans normal, not italic.
325
326 font_family
327 A font family name
328
329 face
330 Synonym for font_family
331
332 size
333 Font size in 1024ths of a point, or one of the absolute sizes
334 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large',
335 'xx-large', or one of the relative sizes 'smaller' or 'larger'. If
336 you want to specify a absolute size, it's usually easier to take
337 advantage of the ability to specify a partial font description
338 using 'font_desc'; you can use font_desc='12.5' rather than
339 size='12800'.
340
341 style
342 One of 'normal', 'oblique', 'italic'
343
344 weight
345 One of 'ultralight', 'light', 'normal', 'bold', 'ultrabold',
346 'heavy', or a numeric weight
347
348 variant
349 'normal' or 'smallcaps'
350
351 stretch
352 One of 'ultracondensed', 'extracondensed', 'condensed',
353 'semicondensed', 'normal', 'semiexpanded', 'expanded',
354 'extraexpanded', 'ultraexpanded'
355
356 foreground
357 An RGB color specification such as '#00FF00' or a color name such
358 as 'red'
359
360 background
361 An RGB color specification such as '#00FF00' or a color name such
362 as 'red'
363
364 underline
365 One of 'none', 'single', 'double', 'low', 'error'
366
367 underline_color
368 The color of underlines; an RGB color specification such as
369 '#00FF00' or a color name such as 'red'
370
371 rise
372 Vertical displacement, in 10000ths of an em. Can be negative for
373 subscript, positive for superscript.
374
375 strikethrough
376 'true' or 'false' whether to strike through the text
377
378 strikethrough_color
379 The color of crossed out lines; an RGB color specification such as
380 '#00FF00' or a color name such as 'red'
381
382 fallback
383 'true' or 'false' whether to enable fallback. If disabled, then
384 characters will only be used from the closest matching font on the
385 system. No fallback will be done to other fonts on the system that
386 might contain the characters in the text. Fallback is enabled by
387 default. Most applications should not disable fallback.
388
389 lang
390 A language code, indicating the text language
391
392 letter_spacing
393 Inter-letter spacing in 1024ths of a point.
394
395 gravity
396 One of 'south', 'east', 'north', 'west', 'auto'.
397
398 gravity_hint
399 One of 'natural', 'strong', 'line'.
400
401 To save you some typing, there are also some shortcuts:
402
403 b Bold
404
405 big Makes font relatively larger, equivalent to <span size="larger">
406
407 i Italic
408
409 s Strike through
410
411 sub Subscript
412
413 sup Superscript
414
415 small
416 Makes font relatively smaller, equivalent to <span size="smaller">
417
418 tt Monospace font
419
420 u Underline
421
423 rrdgraph gives an overview of how rrdtool graph works. rrdgraph_data
424 describes DEF,CDEF and VDEF in detail. rrdgraph_rpn describes the RPN
425 language used in the ?DEF statements. rrdgraph_graph page describes
426 all of the graph and print functions.
427
428 Make sure to read rrdgraph_examples for tips&tricks.
429
431 Program by Tobias Oetiker <tobi@oetiker.ch>
432
433 This manual page by Alex van den Bogaerdt <alex@vandenbogaerdt.nl> with
434 corrections and/or additions by several people
435
436
437
4381.4.8 2013-05-23 RRDGRAPH_GRAPH(1)