Code

3826f08a31d27afd0270cefa9caa73af47f62049
[rrdtool.git] / doc / rrdgraph_graph.src
1 =head1 NAME  
3 =cut
5 WARNING: DO NOT EDIT THE POD FILES. THEY ARE AUTO-GENERATED
7 =pod
9 rrdgraph_graph - rrdtool graph command reference
11 =head1 SYNOPSIS
13 B<PRINT>B<:>I<vname>B<:>I<format>
15 B<GPRINT>B<:>I<vname>B<:>I<format>
17 B<COMMENT>B<:>I<text>
19 B<VRULE>B<:>I<vname>B<#>I<color>[B<:>I<legend>]
21 B<LINE>I<width>B<:>I<vname>B<#>I<color>[B<:>I<legend>][B<:>B<STACK>]
23 B<AREA>B<:>I<vname>B<#>I<color>[B<:>I<legend>][B<:>B<STACK>]
25 B<TICK>B<:>I<vname>B<#>I<rrggbb>[I<aa>][B<:>I<fraction>[B<:>I<legend>]]
27 B<SHIFT>B<:>I<vname>B<:>I<offset>
29 =cut
31 B<PART>B<:>I<vname>B<#>I<rrggbb>[I<aa>][B<:>I<legend>]
33 =pod
35 B<PRINT>B<:>I<vname>B<:>I<CF>B<:>I<format> (deprecated)
37 B<GPRINT>B<:>I<vname>B<:>I<CF>B<:>I<format> (deprecated)
39 B<HRULE>B<:>I<value>B<#>I<color>[B<:>I<legend>] (deprecated)
41 B<STACK>B<:>I<vname>B<#>I<color>[B<:>I<legend>] (deprecated)
43 =head1 DESCRIPTION
45 These instructions allow you to generate your image or report.
46 If you don't use any graph elements, no graph is generated.
47 Similarly no report is generated if you don't use print options.
49 =head1 PRINT
51 =over 4
53 =item B<PRINT:>I<vname>B<:>I<CF><:>I<format>
55 I<Deprecated. Use the new form of this command in new scripts.>
56 The first form of this command is to be used with B<CDEF> I<vname>s.
58 =item B<PRINT:>I<vname>B<:>I<format>
60 Depending on the context, either the value component or the time
61 component of a B<VDEF> is printed using I<format>. It is an error
62 to specify a I<vname> generated by a B<DEF> or B<CDEF>.
64 Any text in I<format> is printed literally with one exception:
65 The percent character introduces a formatter string. This string
66 can be:
68 For printing values:
70 =over 4
72 =item *
74 B<%%> just prints a literal '%' character
76 =item *
78 B<%#.#le> prints like 1.2346e+04. Optional numbers # are field width and
79 decimal precision
81 =item *
83 B<%#.#lf> prints like 12345.6789, with optional field width and precision
85 =item *
87 B<%s> place this after B<%le>, B<%lf> or B<%lg>. This will be replaced by the
88 appropriate SI magnitude unit and the value will be scaled
89 accordingly (123456 -> 123.456 k)
91 =item *
93 B<%S> is similar to B<%s>. It does however use a previously defined
94 magnitude unit. If there is no such unit yet, it tries to define
95 one (just like B<%s>). However, if the value is zero, the magnitude
96 unit stays undefined. Thus, formatter strings using B<%S> and no B<%s>
97 will all use the same magnitude unit except for zero values.
99 =back
101 For printing times:
103 =over 4
105 =item *
107 B<%%> just prints a literal '%' character
109 =item *
111 B<%a, %A> prints abbreviated, full weekday name
113 =item *
115 B<%b, %B> prints abbreviated, full month name
117 =item *
119 B<%d, %m, %y, %H, %M, %S> day,month,year,hour,minute,second all in two-digit format
121 =item *
123 B<%Y> year in 4-digit format
125 =item *
127 B<%I, %p>  hour (01..12), 'am' or 'pm'
129 =item *
131 B<%j, %w> day of the week (0..6), day of the year (1..366)
133 =item *
135 B<%c, %x, %X> date+time, date, time
137 =item *
139 B<%U, %W> week number of the current year with either the first Sunday or
140 the first Monday determining the first week
142 =item *
144 B<%Z> time zone
146 =back
148 =back
150 =head1 GRAPH
152 =over 4
154 =item B<GPRINT>B<:>I<vname>B<:>I<CF>B<:>I<format>
156 I<Deprecated. Use the new form of this command in new scripts.>
157 This is the same as C<PRINT> but now it is printed inside the graph.
159 =item B<GPRINT>B<:>I<vname>B<:>I<format>
161 This is the same as C<PRINT> but now it is printed inside the graph.
163 =item B<COMMENT>B<:>I<text>
165 Text is printed literally in the legend section of the graph
167 =item B<HRULE>B<:>I<value>B<#>I<color> [ :I<legend> ]
169 I<Deprecated. Use B<LINEx> in new scripts.>
171 =item B<VRULE>B<:>I<vname>B<#>I<color> [B<:>I<legend> ]
173 Draw a vertical line at I<time>.  Its color is composed from three
174 hexadecimal numbers specifying the color components (00 is off, FF is
175 maximum) red, green and blue.  Optionally a legend box and string is
176 printed in the legend section. I<time> may be a number or a variable
177 from a B<VDEF>. It is an error to use I<vname>s from B<DEF> or B<CDEF> here.
179 =item B<LINE>I<width>B<:>I<{vname or number}>B<#>I<color>[B<:>I<legend>]
180 [ C<:STACK> ]
182 Draw a line of the specified width into the graph. If the color
183 is not specified, the drawing is done 'blind'.  This is useful when
184 stacking something else on top of this line. Also optional is the
185 legend box and string which will be printed in the legend section
186 if specified. The B<vname> can be generated by B<DEF>, B<VDEF> and
187 B<CDEF>.  If the optional B<STACK> modifier is used, this line is
188 stacked on top of the previous element which can be a B<LINEx> or
189 an B<AREA>
191 =item B<AREA>B<:>I<vname>B<#>I<rrggbb>[I<aa>][B<:>I<legend>][B<:STACK>]
193 See B<LINE>, however the area between the x-axis and the line will
194 also be filled.
196 =item B<TICK>B<:>I<vname>B<#>I<rrggbb>[I<aa>][B<:>I<fraction>[B<:>I<legend>]]
198 Plot a tick mark (a vertical line) for each value of I<vname> that is
199 non-zero and not *UNKNOWN*. The I<fraction> argument specifies the
200 length of the tick mark as a fraction of the y-axis; the default value
201 is 0.1 (10% of the axis). Note that the color specification is not
202 optional.
204 =item B<SHIFT>B<:>I<vname>B<:>I<offset>
206 Using this command B<RRDtool> will graph the following elements
207 with the specified offset.  For instance, you can specify an
208 offset of S<( 7*24*60*60 = ) 604800 seconds> to "look back" one
209 week. Make sure to notify the viewer you did so...
210 As with the other graphing elements, you can specify a number or
211 a variable here.
213 =cut
215 =item B<PART>B<:>I<vname>B<#>I<rrggbb>[I<aa>][B<:>I<legend>]
217 B<RRDtool> has now support for B<pie charts>. If you include the
218 B<PART> command, the canvas is extended to make room for a chart
219 The size of the canvas is determined by the lesser of
220 L<width and height|rrdgraph/item_Size>.
222 Pie parts will be concatenated, the first one will start at the
223 top and parts will be created clockwise.  The size of the part
224 is defined by the value part of the L<VDEF|rrdgraph_data/VDEF>
225 function.  It should return a number between 0 and 100, being a
226 percentage.  Providing wrong input will produce undefined results.
228 =pod
230 =item B<STACK>B<:>I<vname>B<#>I<color>[B<:>I<legend>]
232 I<Deprecated.  Use the B<STACK> modifiers on the other commands.>
234 =back
236 B<Some notes on stacking>
238 When stacking, an element is not placed above the X-axis but rather
239 on top of the previous element.  There must be something to stack
240 upon.
242 An B<invisible> LINEx or AREA B<is> present and can be stacked upon.  
244 An B<unknown> value makes the entire stack unknown from that moment on.
245 You don't know where to begin (the unknown value) and therefore do
246 not know where to end.
248 If you want to make sure you will be displaying a certain variable,
249 make sure never to stack upon the unknown value.  Use a CDEF instruction
250 with B<IF> and B<UN> to do so.
252 =head1 NOTES on legend arguments
254 =head2 Escaping the colon
256 In a ':' in a I<legend> argument will mark the end of the legend. To
257 enter a ':' into a legend, the colon must be escaped with a backslash '\:'.
258 Beware, that many environments look for backslashes themselves, so it may
259 be necessary to write two backslashes so that one is passed onto rrd_graph.
261 =head2 String Formatting
263 The text printed below the actual graph can be formated by appending special
264 escaped characters at the end of a text. When ever such a character occurs,
265 all pending text is pushed onto the graph according to the character
266 specified.
268 Valid markers are: B<\j> for justified, B<\l> for left aligned, B<\r> for
269 right aligned and B<\c> for centered. In the next section there is an
270 example showing how to use centered formating.
272 Normally there are two space characters inserted between every two items
273 printed into the graph. The space following a string can be suppressed by
274 putting a B<\g> at the end of the string. The B<\g> also ignores any space
275 inside the string if it is at the very end of the string. This can be used
276 in connection with B<%s> to suppress empty unit strings.
278  GPRINT:a:MAX:%lf%s\g
280 A special case is COMMENT:B<\s> this inserts some additional vertical space
281 before placing the next row of legends.
283 If you are using the proportional font in your graph, you can use tab characters
284 or the sequence B<\t> to lin-up legend elements. Note that the tabs inserted are
285 relative to the start of the current legend element!
287 =include see_also