Code

Imported upstream version 1.4.8
[pkg-rrdtool.git] / doc / rrdgraph_graph.html
1 <?xml version="1.0" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <title>rrdgraph_graph</title>
6 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7 <link rev="made" href="mailto:root@localhost" />
8 </head>
10 <body style="background-color: white">
13 <!-- INDEX BEGIN -->
14 <div name="index">
15 <p><a name="__index__"></a></p>
16 <!--
18 <ul>
20         <li><a href="#name">NAME</a></li>
21         <li><a href="#synopsis">SYNOPSIS</a></li>
22         <li><a href="#description">DESCRIPTION</a></li>
23         <ul>
25                 <li><a href="#print">PRINT</a></li>
26                 <ul>
28                         <li><a href="#print_vname_format__strftime_"><strong>PRINT:</strong><em>vname</em><strong>:</strong><em>format</em>[<strong>:strftime</strong>]</a></li>
29                         <li><a href="#print_vname_cf_format"><strong>PRINT:</strong><em>vname</em><strong>:</strong><em>CF</em><strong>:</strong><em>format</em></a></li>
30                 </ul>
32                 <li><a href="#graph">GRAPH</a></li>
33                 <ul>
35                         <li><a href="#gprint_vname_format"><strong>GPRINT</strong><strong>:</strong><em>vname</em><strong>:</strong><em>format</em></a></li>
36                         <li><a href="#gprint_vname_cf_format"><strong>GPRINT</strong><strong>:</strong><em>vname</em><strong>:</strong><em>CF</em><strong>:</strong><em>format</em></a></li>
37                         <li><a href="#comment_text"><strong>COMMENT</strong><strong>:</strong><em>text</em></a></li>
38                         <li><a href="#vrule_time_color__legend___dashes__on_s__off_s__on_s_off_s________dash_offset_offset__"><strong>VRULE</strong><strong>:</strong><em>time</em><strong>#</strong><em>color</em>[<strong>:</strong><em>legend</em>][<strong>:dashes</strong>[<strong>=</strong><em>on_s</em>[,<em>off_s</em>[,<em>on_s</em>,<em>off_s</em>]...]][<strong>:dash-offset=</strong><em>offset</em>]]</a></li>
39                         <li><a href="#hrule_value_color__legend___dashes__on_s__off_s__on_s_off_s________dash_offset_offset__"><strong>HRULE</strong><strong>:</strong><em>value</em><strong>#</strong><em>color</em>[<strong>:</strong><em>legend</em>][<strong>:dashes</strong>[<strong>=</strong><em>on_s</em>[,<em>off_s</em>[,<em>on_s</em>,<em>off_s</em>]...]][<strong>:dash-offset=</strong><em>offset</em>]]</a></li>
40                         <li><a href="#line_width__value__color____legend___stack___skipscale____dashes__on_s__off_s__on_s_off_s________dash_offset_offset__"><strong>LINE</strong>[<em>width</em>]<strong>:</strong><em>value</em>[<strong>#</strong><em>color</em>][<strong>:</strong>[<em>legend</em>][<strong>:STACK</strong>][<strong>:skipscale</strong>]][<strong>:dashes</strong>[<strong>=</strong><em>on_s</em>[,<em>off_s</em>[,<em>on_s</em>,<em>off_s</em>]...]][<strong>:dash-offset=</strong><em>offset</em>]]</a></li>
41                         <li><a href="#area_value__color____legend___stack___skipscale__"><strong>AREA</strong><strong>:</strong><em>value</em>[<strong>#</strong><em>color</em>][<strong>:</strong>[<em>legend</em>][<strong>:STACK</strong>][<strong>:skipscale</strong>]]</a></li>
42                         <li><a href="#tick_vname_rrggbb_aa___fraction__legend__"><strong>TICK</strong><strong>:</strong><em>vname</em><strong>#</strong><em>rrggbb</em>[<em>aa</em>][<strong>:</strong><em>fraction</em>[<strong>:</strong><em>legend</em>]]</a></li>
43                         <li><a href="#shift_vname_offset"><strong>SHIFT</strong><strong>:</strong><em>vname</em><strong>:</strong><em>offset</em></a></li>
44                         <li><a href="#textalign__left_right_justified_center_"><strong>TEXTALIGN</strong><strong>:</strong>{<strong>left</strong>|<strong>right</strong>|<strong>justified</strong>|<strong>center</strong>}</a></li>
45                         <li><a href="#stack_vname_color__legend_"><strong>STACK</strong><strong>:</strong><em>vname</em><strong>#</strong><em>color</em>[<strong>:</strong><em>legend</em>]</a></li>
46                 </ul>
48         </ul>
50         <li><a href="#notes_on_legend_arguments">NOTES on legend arguments</a></li>
51         <ul>
53                 <li><a href="#escaping_the_colon">Escaping the colon</a></li>
54                 <li><a href="#string_formatting">String Formatting</a></li>
55         </ul>
57         <li><a href="#see_also">SEE ALSO</a></li>
58         <li><a href="#author">AUTHOR</a></li>
59 </ul>
61 -->
64 </div>
65 <!-- INDEX END -->
67 <p>
68 </p>
69 <hr />
70 <h1><a name="name">NAME</a></h1>
71 <p>rrdgraph_graph - rrdtool graph command reference</p>
72 <p>
73 </p>
74 <hr />
75 <h1><a name="synopsis">SYNOPSIS</a></h1>
76 <p><strong>PRINT</strong><strong>:</strong><em>vname</em><strong>:</strong><em>format</em></p>
77 <p><strong>GPRINT</strong><strong>:</strong><em>vname</em><strong>:</strong><em>format</em></p>
78 <p><strong>COMMENT</strong><strong>:</strong><em>text</em></p>
79 <p><strong>VRULE</strong><strong>:</strong><em>time</em><strong>#</strong><em>color</em>[<strong>:</strong><em>legend</em>][<strong>:dashes</strong>[<strong>=</strong><em>on_s</em>[,<em>off_s</em>[,<em>on_s</em>,<em>off_s</em>]...]][<strong>:dash-offset=</strong><em>offset</em>]]</p>
80 <p><strong>HRULE</strong><strong>:</strong><em>value</em><strong>#</strong><em>color</em>[<strong>:</strong><em>legend</em>][<strong>:dashes</strong>[<strong>=</strong><em>on_s</em>[,<em>off_s</em>[,<em>on_s</em>,<em>off_s</em>]...]][<strong>:dash-offset=</strong><em>offset</em>]]</p>
81 <p><strong>LINE</strong>[<em>width</em>]<strong>:</strong><em>value</em>[<strong>#</strong><em>color</em>][<strong>:</strong>[<em>legend</em>][<strong>:STACK</strong>][<strong>:skipscale</strong>][<strong>:dashes</strong>[<strong>=</strong><em>on_s</em>[,<em>off_s</em>[,<em>on_s</em>,<em>off_s</em>]...]][<strong>:dash-offset=</strong><em>offset</em>]]</p>
82 <p><strong>AREA</strong><strong>:</strong><em>value</em>[<strong>#</strong><em>color</em>][<strong>:</strong>[<em>legend</em>][<strong>:STACK</strong>][<strong>:skipscale</strong>]]</p>
83 <p><strong>TICK</strong><strong>:</strong><em>vname</em><strong>#</strong><em>rrggbb</em>[<em>aa</em>][<strong>:</strong><em>fraction</em>[<strong>:</strong><em>legend</em>]]</p>
84 <p><strong>SHIFT</strong><strong>:</strong><em>vname</em><strong>:</strong><em>offset</em></p>
85 <p><strong>TEXTALIGN</strong><strong>:</strong>{<strong>left</strong>|<strong>right</strong>|<strong>justified</strong>|<strong>center</strong>}</p>
86 <p><strong>PRINT</strong><strong>:</strong><em>vname</em><strong>:</strong><em>CF</em><strong>:</strong><em>format</em> (deprecated)</p>
87 <p><strong>GPRINT</strong><strong>:</strong><em>vname</em><strong>:</strong><em>CF</em><strong>:</strong><em>format</em> (deprecated)</p>
88 <p><strong>STACK</strong><strong>:</strong><em>vname</em><strong>#</strong><em>color</em>[<strong>:</strong><em>legend</em>] (deprecated)</p>
89 <p>
90 </p>
91 <hr />
92 <h1><a name="description">DESCRIPTION</a></h1>
93 <p>These instructions allow you to generate your image or report.
94 If you don't use any graph elements, no graph is generated.
95 Similarly, no report is generated if you don't use print options.</p>
96 <p>
97 </p>
98 <h2><a name="print">PRINT</a></h2>
99 <p>
100 </p>
101 <h3><a name="print_vname_format__strftime_"><strong>PRINT:</strong><em>vname</em><strong>:</strong><em>format</em>[<strong>:strftime</strong>]</a></h3>
102 <p>Depending on the context, either the value component or the time
103 component of a <strong>VDEF</strong> is printed using <em>format</em>. It is an error
104 to specify a <em>vname</em> generated by a <strong>DEF</strong> or <strong>CDEF</strong>.</p>
105 <p>Any text in <em>format</em> is printed literally with one exception:
106 The percent character introduces a formatter string. This string
107 can be:</p>
108 <p>For printing values:</p>
109 <dl>
110 <dt><strong><a name="__" class="item"><strong>%%</strong></a></strong></dt>
112 <dd>
113 <p>just prints a literal '%' character</p>
114 </dd>
115 <dt><strong><a name="____le" class="item"><strong>%#.#le</strong></a></strong></dt>
117 <dd>
118 <p>prints numbers like 1.2346e+04. The optional integers # denote field
119 width and decimal precision.</p>
120 </dd>
121 <dt><strong><a name="____lf" class="item"><strong>%#.#lf</strong></a></strong></dt>
123 <dd>
124 <p>prints numbers like 12345.6789, with optional field width
125 and precision.</p>
126 </dd>
127 <dt><strong><a name="_s" class="item"><strong>%s</strong></a></strong></dt>
129 <dd>
130 <p>place this after <strong>%le</strong>, <strong>%lf</strong> or <strong>%lg</strong>. This will be replaced by the
131 appropriate SI magnitude unit and the value will be scaled
132 accordingly (123456 -&gt; 123.456 k).</p>
133 </dd>
134 <dt><strong><a name="_s" class="item"><strong>%S</strong></a></strong></dt>
136 <dd>
137 <p>is similar to <strong>%s</strong>. It does, however, use a previously defined
138 magnitude unit. If there is no such unit yet, it tries to define
139 one (just like <strong>%s</strong>) unless the value is zero, in which case the magnitude
140 unit stays undefined. Thus, formatter strings using <strong>%S</strong> and no <strong>%s</strong>
141 will all use the same magnitude unit except for zero values.</p>
142 </dd>
143 </dl>
144 <p>If you PRINT a VDEF value, you can also print the time associated with it by appending the string
145 <strong>:strftime</strong> to the format. Note that RRDtool uses the strftime function of your OSs C library. This means that
146 the conversion specifier may vary. Check the manual page if you are uncertain. The following is a list of
147 conversion specifiers usually supported across the board.</p>
148 <dl>
149 <dt><strong><a name="_a" class="item"><strong>%a</strong></a></strong></dt>
151 <dd>
152 <p>The abbreviated weekday name according to the current locale.</p>
153 </dd>
154 <dt><strong><a name="_a" class="item"><strong>%A</strong></a></strong></dt>
156 <dd>
157 <p>The full weekday name according to the current locale.</p>
158 </dd>
159 <dt><strong><a name="_b" class="item"><strong>%b</strong></a></strong></dt>
161 <dd>
162 <p>The abbreviated month name according to the current locale.</p>
163 </dd>
164 <dt><strong><a name="_b" class="item"><strong>%B</strong></a></strong></dt>
166 <dd>
167 <p>The full month name according to the current locale.</p>
168 </dd>
169 <dt><strong><a name="_c" class="item"><strong>%c</strong></a></strong></dt>
171 <dd>
172 <p>The preferred date and time representation for the current locale.</p>
173 </dd>
174 <dt><strong><a name="_d" class="item"><strong>%d</strong></a></strong></dt>
176 <dd>
177 <p>The day of the month as a decimal number (range 01 to 31).</p>
178 </dd>
179 <dt><strong><a name="_h" class="item"><strong>%H</strong></a></strong></dt>
181 <dd>
182 <p>The hour as a decimal number using a 24-hour clock (range 00 to 23).</p>
183 </dd>
184 <dt><strong><a name="_i" class="item"><strong>%I</strong></a></strong></dt>
186 <dd>
187 <p>The hour as a decimal number using a 12-hour clock (range 01 to 12).</p>
188 </dd>
189 <dt><strong><a name="_j" class="item"><strong>%j</strong></a></strong></dt>
191 <dd>
192 <p>The day of the year as a decimal number (range 001 to 366).</p>
193 </dd>
194 <dt><strong><a name="_m" class="item"><strong>%m</strong></a></strong></dt>
196 <dd>
197 <p>The month as a decimal number (range 01 to 12).</p>
198 </dd>
199 <dt><strong><a name="_m" class="item"><strong>%M</strong></a></strong></dt>
201 <dd>
202 <p>The minute as a decimal number (range 00 to 59).</p>
203 </dd>
204 <dt><strong><a name="_p" class="item"><strong>%p</strong></a></strong></dt>
206 <dd>
207 <p>Either `AM' or `PM' according to the given time value, or the corresponding
208 strings for the current locale.  Noon is treated as `pm' and midnight as
209 `am'.  Note that in many locales and `pm' notation is unsupported and in
210 such cases %p will return an empty string.</p>
211 </dd>
212 <dt><strong><strong>%s</strong></strong></dt>
214 <dd>
215 <p>The second as a decimal number (range 00 to 61).</p>
216 </dd>
217 <dt><strong><strong>%S</strong></strong></dt>
219 <dd>
220 <p>The seconds since the epoch (1.1.1970) (libc dependent non standard!)</p>
221 </dd>
222 <dt><strong><a name="_u" class="item"><strong>%U</strong></a></strong></dt>
224 <dd>
225 <p>The  week  number  of  the current year as a decimal number, range 00 to 53, starting with the
226 first Sunday as the first day of week 01. See also %V and %W.</p>
227 </dd>
228 <dt><strong><a name="_v" class="item"><strong>%V</strong></a></strong></dt>
230 <dd>
231 <p>The ISO 8601:1988 week number of the current year as a decimal number, range 01 to  53,  where
232 week  1 is the first week that has at least 4 days in the current year, and with Monday as the
233 first day of the week. See also %U and %W.</p>
234 </dd>
235 <dt><strong><a name="_w" class="item"><strong>%w</strong></a></strong></dt>
237 <dd>
238 <p>The day of the week as a decimal, range 0 to 6, Sunday being 0.  See also %u.</p>
239 </dd>
240 <dt><strong><a name="_w" class="item"><strong>%W</strong></a></strong></dt>
242 <dd>
243 <p>The week number of the current year as a decimal number, range 00 to  53,  starting  with  the
244 first Monday as the first day of week 01.</p>
245 </dd>
246 <dt><strong><a name="_x" class="item"><strong>%x</strong></a></strong></dt>
248 <dd>
249 <p>The preferred date representation for the current locale without the time.</p>
250 </dd>
251 <dt><strong><a name="_x" class="item"><strong>%X</strong></a></strong></dt>
253 <dd>
254 <p>The preferred time representation for the current locale without the date.</p>
255 </dd>
256 <dt><strong><a name="_y" class="item"><strong>%y</strong></a></strong></dt>
258 <dd>
259 <p>The year as a decimal number without a century (range 00 to 99).</p>
260 </dd>
261 <dt><strong><a name="_y" class="item"><strong>%Y</strong></a></strong></dt>
263 <dd>
264 <p>The year as a decimal number including the century.</p>
265 </dd>
266 <dt><strong><a name="_z" class="item"><strong>%Z</strong></a></strong></dt>
268 <dd>
269 <p>The time zone or name or abbreviation.</p>
270 </dd>
271 <dt><strong><strong>%%</strong></strong></dt>
273 <dd>
274 <p>A literal `%' character.</p>
275 </dd>
276 </dl>
277 <p>
278 </p>
279 <h3><a name="print_vname_cf_format"><strong>PRINT:</strong><em>vname</em><strong>:</strong><em>CF</em><strong>:</strong><em>format</em></a></h3>
280 <p><em>Deprecated. Use the new form of this command in new scripts.</em>
281 The first form of this command is to be used with <strong>CDEF</strong> <em>vname</em>s.</p>
282 <p>
283 </p>
284 <h2><a name="graph">GRAPH</a></h2>
285 <p>
286 </p>
287 <h3><a name="gprint_vname_format"><strong>GPRINT</strong><strong>:</strong><em>vname</em><strong>:</strong><em>format</em></a></h3>
288 <p>This is the same as <code>PRINT</code>, but printed inside the graph.</p>
289 <p>
290 </p>
291 <h3><a name="gprint_vname_cf_format"><strong>GPRINT</strong><strong>:</strong><em>vname</em><strong>:</strong><em>CF</em><strong>:</strong><em>format</em></a></h3>
292 <p><em>Deprecated. Use the new form of this command in new scripts.</em>
293 This is the same as <code>PRINT</code>, but printed inside the graph.</p>
294 <p>
295 </p>
296 <h3><a name="comment_text"><strong>COMMENT</strong><strong>:</strong><em>text</em></a></h3>
297 <p>Text is printed literally in the legend section of the graph. Note that in
298 RRDtool 1.2 you have to escape colons in COMMENT text in the same way you
299 have to escape them in <strong>*PRINT</strong> commands by writing <strong>'\:'</strong>.</p>
300 <p>
301 </p>
302 <h3><a name="vrule_time_color__legend___dashes__on_s__off_s__on_s_off_s________dash_offset_offset__"><strong>VRULE</strong><strong>:</strong><em>time</em><strong>#</strong><em>color</em>[<strong>:</strong><em>legend</em>][<strong>:dashes</strong>[<strong>=</strong><em>on_s</em>[,<em>off_s</em>[,<em>on_s</em>,<em>off_s</em>]...]][<strong>:dash-offset=</strong><em>offset</em>]]</a></h3>
303 <p>Draw a vertical line at <em>time</em>.  Its color is composed from three
304 hexadecimal numbers specifying the rgb color components (00 is off, FF is
305 maximum) red, green and blue followed by an optional alpha. Optionally, a legend box and string is
306 printed in the legend section. <em>time</em> may be a number or a variable
307 from a <strong>VDEF</strong>. It is an error to use <em>vname</em>s from <strong>DEF</strong> or <strong>CDEF</strong> here.
308 Dashed lines can be drawn using the <strong>dashes</strong> modifier. See <strong>LINE</strong> for more
309 details.</p>
310 <p>
311 </p>
312 <h3><a name="hrule_value_color__legend___dashes__on_s__off_s__on_s_off_s________dash_offset_offset__"><strong>HRULE</strong><strong>:</strong><em>value</em><strong>#</strong><em>color</em>[<strong>:</strong><em>legend</em>][<strong>:dashes</strong>[<strong>=</strong><em>on_s</em>[,<em>off_s</em>[,<em>on_s</em>,<em>off_s</em>]...]][<strong>:dash-offset=</strong><em>offset</em>]]</a></h3>
313 <p>Draw a horizontal line at <em>value</em>.  HRULE acts much like LINE except that
314 will have no effect on the scale of the graph. If a HRULE is outside the
315 graphing area it will just not be visible.</p>
316 <p>
317 </p>
318 <h3><a name="line_width__value__color____legend___stack___skipscale____dashes__on_s__off_s__on_s_off_s________dash_offset_offset__"><strong>LINE</strong>[<em>width</em>]<strong>:</strong><em>value</em>[<strong>#</strong><em>color</em>][<strong>:</strong>[<em>legend</em>][<strong>:STACK</strong>][<strong>:skipscale</strong>]][<strong>:dashes</strong>[<strong>=</strong><em>on_s</em>[,<em>off_s</em>[,<em>on_s</em>,<em>off_s</em>]...]][<strong>:dash-offset=</strong><em>offset</em>]]</a></h3>
319 <p>Draw a line of the specified width onto the graph. <em>width</em> can be a
320 floating point number. If the color is not specified, the drawing is done
321 'invisibly'. This is useful when stacking something else on top of this
322 line. Also optional is the legend box and string which will be printed in
323 the legend section if specified. The <strong>value</strong> can be generated by <strong>DEF</strong>,
324 <strong>VDEF</strong>, and <strong>CDEF</strong>.  If the optional <strong>STACK</strong> modifier is used, this line
325 is stacked on top of the previous element which can be a <strong>LINE</strong> or an
326 <strong>AREA</strong>.</p>
327 <p>Normally the graphing function makes sure that the entire <strong>LINE</strong> or <strong>AREA</strong>
328 is visible in the chart. The scaling of the chart will be modified
329 accordingly if necessary. Any <strong>LINE</strong> or <strong>AREA</strong> can be excluded from this
330 process by adding the option <strong>skipscale</strong>.</p>
331 <p>The <strong>dashes</strong> modifier enables dashed line style. Without any further options
332 a symmetric dashed line with a segment length of 5 pixels will be drawn. The
333 dash pattern can be changed if the <strong>dashes=</strong> parameter is followed by either
334 one value or an even number (1, 2, 4, 6, ...) of positive values. Each value
335 provides the length of alternate <em>on_s</em> and <em>off_s</em> portions of the
336 stroke. The <strong>dash-offset</strong> parameter specifies an <em>offset</em> into the pattern
337 at which the stroke begins.</p>
338 <p>When you do not specify a color, you cannot specify a legend.  Should
339 you want to use <strong>STACK</strong>, use the &quot;LINEx:&lt;value&gt;::STACK&quot; form.</p>
340 <p>
341 </p>
342 <h3><a name="area_value__color____legend___stack___skipscale__"><strong>AREA</strong><strong>:</strong><em>value</em>[<strong>#</strong><em>color</em>][<strong>:</strong>[<em>legend</em>][<strong>:STACK</strong>][<strong>:skipscale</strong>]]</a></h3>
343 <p>See <strong>LINE</strong>, however the area between the x-axis and the line will
344 be filled.</p>
345 <p>
346 </p>
347 <h3><a name="tick_vname_rrggbb_aa___fraction__legend__"><strong>TICK</strong><strong>:</strong><em>vname</em><strong>#</strong><em>rrggbb</em>[<em>aa</em>][<strong>:</strong><em>fraction</em>[<strong>:</strong><em>legend</em>]]</a></h3>
348 <p>Plot a tick mark (a vertical line) for each value of <em>vname</em> that is
349 non-zero and not *UNKNOWN*. The <em>fraction</em> argument specifies the length of
350 the tick mark as a fraction of the y-axis; the default value is 0.1 (10% of
351 the axis). Note that the color specification is not optional. The TICK marks normally
352 start at the lower edge of the graphing area. If the fraction is negative they start
353 at the upper border of the graphing area.</p>
354 <p>
355 </p>
356 <h3><a name="shift_vname_offset"><strong>SHIFT</strong><strong>:</strong><em>vname</em><strong>:</strong><em>offset</em></a></h3>
357 <p>Using this command <strong>RRDtool</strong> will graph the following elements
358 with the specified offset.  For instance, you can specify an
359 offset of (&nbsp;7*24*60*60&nbsp;=&nbsp;)&nbsp;604'800&nbsp;seconds to &quot;look back&quot; one
360 week. Make sure to tell the viewer of your graph you did this ...
361 As with the other graphing elements, you can specify a number or
362 a variable here.</p>
363 <p>
364 </p>
365 <h3><a name="textalign__left_right_justified_center_"><strong>TEXTALIGN</strong><strong>:</strong>{<strong>left</strong>|<strong>right</strong>|<strong>justified</strong>|<strong>center</strong>}</a></h3>
366 <p>Labels are placed below the graph. When they overflow to the left, they wrap
367 to the next line. By default, lines are justified left and right. The
368 <strong>TEXTALIGN</strong> function lets you change this default. This is a command and
369 not an option, so that you can change the default several times in your
370 argument list.</p>
371 <p>
372 </p>
373 <h3><a name="stack_vname_color__legend_"><strong>STACK</strong><strong>:</strong><em>vname</em><strong>#</strong><em>color</em>[<strong>:</strong><em>legend</em>]</a></h3>
374 <p><em>Deprecated.  Use the <strong>STACK</strong> modifiers on the other commands instead!</em></p>
375 <p><strong>Some notes on stacking</strong></p>
376 <p>When stacking, an element is not placed above the X-axis but rather
377 on top of the previous element.  There must be something to stack
378 upon.</p>
379 <p>You can use an <strong>invisible</strong> LINE or AREA to stacked upon.</p>
380 <p>An <strong>unknown</strong> value makes the entire stack unknown from that moment on.
381 You don't know where to begin (the unknown value) and therefore do
382 not know where to end.</p>
383 <p>If you want to make sure you will be displaying a certain variable,
384 make sure never to stack upon the unknown value.  Use a CDEF instruction
385 with <strong>IF</strong> and <strong>UN</strong> to do so.</p>
386 <p>
387 </p>
388 <hr />
389 <h1><a name="notes_on_legend_arguments">NOTES on legend arguments</a></h1>
390 <p>
391 </p>
392 <h2><a name="escaping_the_colon">Escaping the colon</a></h2>
393 <p>A colon ':' in a <em>legend</em> argument will mark the end of the
394 legend. To enter a ':' as part of a legend, the colon must be escaped
395 with a backslash '\:'.  Beware that many environments process
396 backslashes themselves, so it may be necessary to write two
397 backslashes in order to one being passed onto rrd_graph.</p>
398 <p>
399 </p>
400 <h2><a name="string_formatting">String Formatting</a></h2>
401 <p>The text printed below the actual graph can be formatted by appending special
402 escape characters at the end of a text. When ever such a character occurs,
403 all pending text is pushed onto the graph according to the character
404 specified.</p>
405 <p>Valid markers are: <strong>\j</strong> for justified, <strong>\l</strong> for left aligned, <strong>\r</strong> for
406 right aligned, and <strong>\c</strong> for centered. In the next section there is an
407 example showing how to use centered formatting.</p>
408 <p><strong>\n</strong> is a valid alias for <strong>\l</strong> since incomplete parsing in earlier
409 versions of RRDtool lead to this behavior and a number of people has been using it.</p>
410 <p>Normally there are two space characters inserted between every two items
411 printed into the graph. The space following a string can be suppressed by
412 putting a <strong>\g</strong> at the end of the string. The <strong>\g</strong> also ignores any space
413 inside the string if it is at the very end of the string. This can be used
414 in connection with <strong>%s</strong> to suppress empty unit strings.</p>
415 <pre>
416  GPRINT:a:MAX:%lf%s\g</pre>
417 <p>A special case is COMMENT:<strong>\s</strong> which inserts some additional vertical space
418 before placing the next row of legends.</p>
419 <p>If you want to have left and right aligned legends on the same line use COMMENT:<strong>\u</strong>
420 to go one line back like this:</p>
421 <pre>
422  COMMENT:left\l
423  COMMENT:\u
424  COMMENT:right\r</pre>
425 <p>There is also a 'nop' control for situations where you want a string to
426 actually end in a backslash character sequence <strong>\.</strong></p>
427 <pre>
428  COMMENT:OS\2\.</pre>
429 <p>When using a proportional font in your graph, the tab
430 characters or the sequence <strong>\t</strong> will line-up legend elements. Note that
431 the tabs inserted are relative to the start of the current legend
432 element!</p>
433 <p>Since RRDtool 1.3 is using Pango for rending text, you can use Pango markup.
434 Pango uses the xml <strong>span</strong> tags for inline formatting instructions.:</p>
435 <p>A simple example of a marked-up string might be:</p>
436 <pre>
437  &lt;span foreground=&quot;blue&quot; size=&quot;x-large&quot;&gt;Blue text&lt;/span&gt; is &lt;i&gt;cool&lt;/i&gt;!</pre>
438 <p>The complete list of attributes for the span tag (taken from the pango documentation):</p>
439 <dl>
440 <dt><strong><a name="font_desc" class="item"><strong>font_desc</strong></a></strong></dt>
442 <dd>
443 <p>A font description string, such as &quot;Sans Italic 12&quot;; note that any other span attributes will override this description. So if you have &quot;Sans Italic&quot; and also a style=&quot;normal&quot; attribute, you will get Sans normal, not italic.</p>
444 </dd>
445 <dt><strong><a name="font_family" class="item"><strong>font_family</strong></a></strong></dt>
447 <dd>
448 <p>A font family name</p>
449 </dd>
450 <dt><strong><a name="face" class="item"><strong>face</strong></a></strong></dt>
452 <dd>
453 <p>Synonym for font_family</p>
454 </dd>
455 <dt><strong><a name="size" class="item"><strong>size</strong></a></strong></dt>
457 <dd>
458 <p>Font size in 1024ths of a point, or one of the absolute sizes 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', or one of the relative sizes 'smaller' or 'larger'. If you want to specify a absolute size, it's usually easier to take advantage of the ability to specify a partial font description using 'font_desc'; you can use font_desc='12.5' rather than size='12800'.</p>
459 </dd>
460 <dt><strong><a name="style" class="item"><strong>style</strong></a></strong></dt>
462 <dd>
463 <p>One of 'normal', 'oblique', 'italic'</p>
464 </dd>
465 <dt><strong><a name="weight" class="item"><strong>weight</strong></a></strong></dt>
467 <dd>
468 <p>One of 'ultralight', 'light', 'normal', 'bold', 'ultrabold', 'heavy', or a numeric weight</p>
469 </dd>
470 <dt><strong><a name="variant" class="item"><strong>variant</strong></a></strong></dt>
472 <dd>
473 <p>'normal' or 'smallcaps'</p>
474 </dd>
475 <dt><strong><a name="stretch" class="item"><strong>stretch</strong></a></strong></dt>
477 <dd>
478 <p>One of 'ultracondensed', 'extracondensed', 'condensed', 'semicondensed', 'normal', 'semiexpanded', 'expanded', 'extraexpanded', 'ultraexpanded'</p>
479 </dd>
480 <dt><strong><a name="foreground" class="item"><strong>foreground</strong></a></strong></dt>
482 <dd>
483 <p>An RGB color specification such as '#00FF00' or a color name such as 'red'</p>
484 </dd>
485 <dt><strong><a name="background" class="item"><strong>background</strong></a></strong></dt>
487 <dd>
488 <p>An RGB color specification such as '#00FF00' or a color name such as 'red'</p>
489 </dd>
490 <dt><strong><a name="underline" class="item"><strong>underline</strong></a></strong></dt>
492 <dd>
493 <p>One of 'none', 'single', 'double', 'low', 'error'</p>
494 </dd>
495 <dt><strong><a name="underline_color" class="item"><strong>underline_color</strong></a></strong></dt>
497 <dd>
498 <p>The color of underlines; an RGB color specification such as '#00FF00' or a color name such as 'red'</p>
499 </dd>
500 <dt><strong><a name="rise" class="item"><strong>rise</strong></a></strong></dt>
502 <dd>
503 <p>Vertical displacement, in 10000ths of an em. Can be negative for subscript, positive for superscript.</p>
504 </dd>
505 <dt><strong><a name="strikethrough" class="item"><strong>strikethrough</strong></a></strong></dt>
507 <dd>
508 <p>'true' or 'false' whether to strike through the text</p>
509 </dd>
510 <dt><strong><a name="strikethrough_color" class="item"><strong>strikethrough_color</strong></a></strong></dt>
512 <dd>
513 <p>The color of crossed out lines; an RGB color specification such as '#00FF00' or a color name such as 'red'</p>
514 </dd>
515 <dt><strong><a name="fallback" class="item"><strong>fallback</strong></a></strong></dt>
517 <dd>
518 <p>'true' or 'false' whether to enable fallback. If disabled, then characters will only be used from the closest matching font on the system. No fallback will be done to other fonts on the system that might contain the characters in the text. Fallback is enabled by default. Most applications should not disable fallback.</p>
519 </dd>
520 <dt><strong><a name="lang" class="item"><strong>lang</strong></a></strong></dt>
522 <dd>
523 <p>A language code, indicating the text language</p>
524 </dd>
525 <dt><strong><a name="letter_spacing" class="item"><strong>letter_spacing</strong></a></strong></dt>
527 <dd>
528 <p>Inter-letter spacing in 1024ths of a point.</p>
529 </dd>
530 <dt><strong><a name="gravity" class="item"><strong>gravity</strong></a></strong></dt>
532 <dd>
533 <p>One of 'south', 'east', 'north', 'west', 'auto'.</p>
534 </dd>
535 <dt><strong><a name="gravity_hint" class="item"><strong>gravity_hint</strong></a></strong></dt>
537 <dd>
538 <p>One of 'natural', 'strong', 'line'.</p>
539 </dd>
540 </dl>
541 <p>To save you some typing, there are also some shortcuts:</p>
542 <dl>
543 <dt><strong><a name="b" class="item"><strong>b</strong></a></strong></dt>
545 <dd>
546 <p>Bold</p>
547 </dd>
548 <dt><strong><a name="big" class="item"><strong>big</strong></a></strong></dt>
550 <dd>
551 <p>Makes font relatively larger, equivalent to &lt;span size=&quot;larger&quot;&gt;</p>
552 </dd>
553 <dt><strong><a name="i" class="item"><strong>i</strong></a></strong></dt>
555 <dd>
556 <p>Italic</p>
557 </dd>
558 <dt><strong><a name="s" class="item"><strong>s</strong></a></strong></dt>
560 <dd>
561 <p>Strike through</p>
562 </dd>
563 <dt><strong><a name="sub" class="item"><strong>sub</strong></a></strong></dt>
565 <dd>
566 <p>Subscript</p>
567 </dd>
568 <dt><strong><a name="sup" class="item"><strong>sup</strong></a></strong></dt>
570 <dd>
571 <p>Superscript</p>
572 </dd>
573 <dt><strong><a name="small" class="item"><strong>small</strong></a></strong></dt>
575 <dd>
576 <p>Makes font relatively smaller, equivalent to &lt;span size=&quot;smaller&quot;&gt;</p>
577 </dd>
578 <dt><strong><a name="tt" class="item"><strong>tt</strong></a></strong></dt>
580 <dd>
581 <p>Monospace font</p>
582 </dd>
583 <dt><strong><a name="u" class="item"><strong>u</strong></a></strong></dt>
585 <dd>
586 <p>Underline</p>
587 </dd>
588 </dl>
589 <p>
590 </p>
591 <hr />
592 <h1><a name="see_also">SEE ALSO</a></h1>
593 <p><a href="././rrdgraph.html">the rrdgraph manpage</a> gives an overview of how <strong>rrdtool graph</strong> works.
594 <a href="././rrdgraph_data.html">the rrdgraph_data manpage</a> describes <strong>DEF</strong>,<strong>CDEF</strong> and <strong>VDEF</strong> in detail.
595 <a href="././rrdgraph_rpn.html">the rrdgraph_rpn manpage</a> describes the <strong>RPN</strong> language used in the <strong>?DEF</strong> statements.
596 <a href="././rrdgraph_graph.html">the rrdgraph_graph manpage</a> page describes all of the graph and print functions.</p>
597 <p>Make sure to read <a href="././rrdgraph_examples.html">the rrdgraph_examples manpage</a> for tips&amp;tricks.</p>
598 <p>
599 </p>
600 <hr />
601 <h1><a name="author">AUTHOR</a></h1>
602 <p>Program by Tobias Oetiker &lt;<a href="mailto:tobi@oetiker.ch">tobi@oetiker.ch</a>&gt;</p>
603 <p>This manual page by Alex van den Bogaerdt &lt;<a href="mailto:alex@vandenbogaerdt.nl">alex@vandenbogaerdt.nl</a>&gt;
604 with corrections and/or additions by several people</p>
606 </body>
608 </html>