Code

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