Code

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