Code

Imported upstream SVN snapshot 1.4~rc2+20090928.
[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____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>: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__"><strong>AREA</strong><strong>:</strong><em>value</em>[<strong>#</strong><em>color</em>][<strong>:</strong>[<em>legend</em>][<strong>:STACK</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>: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>]]</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 dependant 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____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>: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>The <strong>dashes</strong> modifier enables dashed line style. Without any further options
328 a symmetric dashed line with a segment length of 5 pixels will be drawn. The
329 dash pattern can be changed if the <strong>dashes=</strong> parameter is followed by either
330 one value or an even number (1, 2, 4, 6, ...) of positive values. Each value
331 provides the length of alternate <em>on_s</em> and <em>off_s</em> portions of the
332 stroke. The <strong>dash-offset</strong> parameter specifies an <em>offset</em> into the pattern
333 at which the stroke begins.</p>
334 <p>When you do not specify a color, you cannot specify a legend.  Should
335 you want to use STACK, use the &quot;LINEx:&lt;value&gt;::STACK&quot; form.</p>
336 <p>
337 </p>
338 <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>
339 <p>See <strong>LINE</strong>, however the area between the x-axis and the line will
340 be filled.</p>
341 <p>
342 </p>
343 <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>
344 <p>Plot a tick mark (a vertical line) for each value of <em>vname</em> that is
345 non-zero and not *UNKNOWN*. The <em>fraction</em> argument specifies the length of
346 the tick mark as a fraction of the y-axis; the default value is 0.1 (10% of
347 the axis). Note that the color specification is not optional. The TICK marks normally
348 start at the lower edge of the graphing area. If the fraction is negative they start
349 at the upper border of the graphing area.</p>
350 <p>
351 </p>
352 <h3><a name="shift_vname_offset"><strong>SHIFT</strong><strong>:</strong><em>vname</em><strong>:</strong><em>offset</em></a></h3>
353 <p>Using this command <strong>RRDtool</strong> will graph the following elements
354 with the specified offset.  For instance, you can specify an
355 offset of (&nbsp;7*24*60*60&nbsp;=&nbsp;)&nbsp;604'800&nbsp;seconds to &quot;look back&quot; one
356 week. Make sure to tell the viewer of your graph you did this ...
357 As with the other graphing elements, you can specify a number or
358 a variable here.</p>
359 <p>
360 </p>
361 <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>
362 <p>Labels are placed below the graph. When they overflow to the left, they wrap
363 to the next line. By default, lines are justified left and right. The
364 <strong>TEXTALIGN</strong> function lets you change this default. This is a command and
365 not an option, so that you can change the default several times in your
366 argument list.</p>
367 <p>
368 </p>
369 <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>
370 <p><em>Deprecated.  Use the <strong>STACK</strong> modifiers on the other commands instead!</em></p>
371 <p><strong>Some notes on stacking</strong></p>
372 <p>When stacking, an element is not placed above the X-axis but rather
373 on top of the previous element.  There must be something to stack
374 upon.</p>
375 <p>You can use an <strong>invisible</strong> LINE or AREA to stacked upon.</p>
376 <p>An <strong>unknown</strong> value makes the entire stack unknown from that moment on.
377 You don't know where to begin (the unknown value) and therefore do
378 not know where to end.</p>
379 <p>If you want to make sure you will be displaying a certain variable,
380 make sure never to stack upon the unknown value.  Use a CDEF instruction
381 with <strong>IF</strong> and <strong>UN</strong> to do so.</p>
382 <p>
383 </p>
384 <hr />
385 <h1><a name="notes_on_legend_arguments">NOTES on legend arguments</a></h1>
386 <p>
387 </p>
388 <h2><a name="escaping_the_colon">Escaping the colon</a></h2>
389 <p>A colon ':' in a <em>legend</em> argument will mark the end of the
390 legend. To enter a ':' as part of a legend, the colon must be escaped
391 with a backslash '\:'.  Beware that many environments process
392 backslashes themselves, so it may be necessary to write two
393 backslashes in order to one being passed onto rrd_graph.</p>
394 <p>
395 </p>
396 <h2><a name="string_formatting">String Formatting</a></h2>
397 <p>The text printed below the actual graph can be formatted by appending special
398 escape characters at the end of a text. When ever such a character occurs,
399 all pending text is pushed onto the graph according to the character
400 specified.</p>
401 <p>Valid markers are: <strong>\j</strong> for justified, <strong>\l</strong> for left aligned, <strong>\r</strong> for
402 right aligned, and <strong>\c</strong> for centered. In the next section there is an
403 example showing how to use centered formatting.</p>
404 <p><strong>\n</strong> is a valid alias for <strong>\l</strong> since incomplete parsing in earlier
405 versions of rrdtool lead to this behavior and a number of people has been using it.</p>
406 <p>Normally there are two space characters inserted between every two items
407 printed into the graph. The space following a string can be suppressed by
408 putting a <strong>\g</strong> at the end of the string. The <strong>\g</strong> also ignores any space
409 inside the string if it is at the very end of the string. This can be used
410 in connection with <strong>%s</strong> to suppress empty unit strings.</p>
411 <pre>
412  GPRINT:a:MAX:%lf%s\g</pre>
413 <p>A special case is COMMENT:<strong>\s</strong> which inserts some additional vertical space
414 before placing the next row of legends.</p>
415 <p>If you are using the proportional font in your graph, you can use tab
416 characters or the sequence <strong>\t</strong> to line-up legend elements. Note that
417 the tabs inserted are relative to the start of the current legend
418 element!</p>
419 <p>Since RRDtool 1.3 is using Pango for rending text, you can use Pango markup.
420 Pango uses the xml <strong>span</strong> tags for inline formatting instructions.:</p>
421 <p>A simple example of a marked-up string might be:</p>
422 <pre>
423  &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>
424 <p>The complete list of attributes for the span tag (taken from the pango documentation):</p>
425 <dl>
426 <dt><strong><a name="font_desc" class="item"><strong>font_desc</strong></a></strong></dt>
428 <dd>
429 <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>
430 </dd>
431 <dt><strong><a name="font_family" class="item"><strong>font_family</strong></a></strong></dt>
433 <dd>
434 <p>A font family name</p>
435 </dd>
436 <dt><strong><a name="face" class="item"><strong>face</strong></a></strong></dt>
438 <dd>
439 <p>Synonym for font_family</p>
440 </dd>
441 <dt><strong><a name="size" class="item"><strong>size</strong></a></strong></dt>
443 <dd>
444 <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>
445 </dd>
446 <dt><strong><a name="style" class="item"><strong>style</strong></a></strong></dt>
448 <dd>
449 <p>One of 'normal', 'oblique', 'italic'</p>
450 </dd>
451 <dt><strong><a name="weight" class="item"><strong>weight</strong></a></strong></dt>
453 <dd>
454 <p>One of 'ultralight', 'light', 'normal', 'bold', 'ultrabold', 'heavy', or a numeric weight</p>
455 </dd>
456 <dt><strong><a name="variant" class="item"><strong>variant</strong></a></strong></dt>
458 <dd>
459 <p>'normal' or 'smallcaps'</p>
460 </dd>
461 <dt><strong><a name="stretch" class="item"><strong>stretch</strong></a></strong></dt>
463 <dd>
464 <p>One of 'ultracondensed', 'extracondensed', 'condensed', 'semicondensed', 'normal', 'semiexpanded', 'expanded', 'extraexpanded', 'ultraexpanded'</p>
465 </dd>
466 <dt><strong><a name="foreground" class="item"><strong>foreground</strong></a></strong></dt>
468 <dd>
469 <p>An RGB color specification such as '#00FF00' or a color name such as 'red'</p>
470 </dd>
471 <dt><strong><a name="background" class="item"><strong>background</strong></a></strong></dt>
473 <dd>
474 <p>An RGB color specification such as '#00FF00' or a color name such as 'red'</p>
475 </dd>
476 <dt><strong><a name="underline" class="item"><strong>underline</strong></a></strong></dt>
478 <dd>
479 <p>One of 'none', 'single', 'double', 'low', 'error'</p>
480 </dd>
481 <dt><strong><a name="underline_color" class="item"><strong>underline_color</strong></a></strong></dt>
483 <dd>
484 <p>The color of underlines; an RGB color specification such as '#00FF00' or a color name such as 'red'</p>
485 </dd>
486 <dt><strong><a name="rise" class="item"><strong>rise</strong></a></strong></dt>
488 <dd>
489 <p>Vertical displacement, in 10000ths of an em. Can be negative for subscript, positive for superscript.</p>
490 </dd>
491 <dt><strong><a name="strikethrough" class="item"><strong>strikethrough</strong></a></strong></dt>
493 <dd>
494 <p>'true' or 'false' whether to strike through the text</p>
495 </dd>
496 <dt><strong><a name="strikethrough_color" class="item"><strong>strikethrough_color</strong></a></strong></dt>
498 <dd>
499 <p>The color of strikethrough lines; an RGB color specification such as '#00FF00' or a color name such as 'red'</p>
500 </dd>
501 <dt><strong><a name="fallback" class="item"><strong>fallback</strong></a></strong></dt>
503 <dd>
504 <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>
505 </dd>
506 <dt><strong><a name="lang" class="item"><strong>lang</strong></a></strong></dt>
508 <dd>
509 <p>A language code, indicating the text language</p>
510 </dd>
511 <dt><strong><a name="letter_spacing" class="item"><strong>letter_spacing</strong></a></strong></dt>
513 <dd>
514 <p>Inter-letter spacing in 1024ths of a point.</p>
515 </dd>
516 <dt><strong><a name="gravity" class="item"><strong>gravity</strong></a></strong></dt>
518 <dd>
519 <p>One of 'south', 'east', 'north', 'west', 'auto'.</p>
520 </dd>
521 <dt><strong><a name="gravity_hint" class="item"><strong>gravity_hint</strong></a></strong></dt>
523 <dd>
524 <p>One of 'natural', 'strong', 'line'.</p>
525 </dd>
526 </dl>
527 <p>To save you some typing, there are also some shortcuts:</p>
528 <dl>
529 <dt><strong><a name="b" class="item"><strong>b</strong></a></strong></dt>
531 <dd>
532 <p>Bold</p>
533 </dd>
534 <dt><strong><a name="big" class="item"><strong>big</strong></a></strong></dt>
536 <dd>
537 <p>Makes font relatively larger, equivalent to &lt;span size=&quot;larger&quot;&gt;</p>
538 </dd>
539 <dt><strong><a name="i" class="item"><strong>i</strong></a></strong></dt>
541 <dd>
542 <p>Italic</p>
543 </dd>
544 <dt><strong><a name="s" class="item"><strong>s</strong></a></strong></dt>
546 <dd>
547 <p>Strikethrough</p>
548 </dd>
549 <dt><strong><a name="sub" class="item"><strong>sub</strong></a></strong></dt>
551 <dd>
552 <p>Subscript</p>
553 </dd>
554 <dt><strong><a name="sup" class="item"><strong>sup</strong></a></strong></dt>
556 <dd>
557 <p>Superscript</p>
558 </dd>
559 <dt><strong><a name="small" class="item"><strong>small</strong></a></strong></dt>
561 <dd>
562 <p>Makes font relatively smaller, equivalent to &lt;span size=&quot;smaller&quot;&gt;</p>
563 </dd>
564 <dt><strong><a name="tt" class="item"><strong>tt</strong></a></strong></dt>
566 <dd>
567 <p>Monospace font</p>
568 </dd>
569 <dt><strong><a name="u" class="item"><strong>u</strong></a></strong></dt>
571 <dd>
572 <p>Underline</p>
573 </dd>
574 </dl>
575 <p>
576 </p>
577 <hr />
578 <h1><a name="see_also">SEE ALSO</a></h1>
579 <p><a href="././rrdgraph.html">the rrdgraph manpage</a> gives an overview of how <strong>rrdtool graph</strong> works.
580 <a href="././rrdgraph_data.html">the rrdgraph_data manpage</a> describes <strong>DEF</strong>,<strong>CDEF</strong> and <strong>VDEF</strong> in detail.
581 <a href="././rrdgraph_rpn.html">the rrdgraph_rpn manpage</a> describes the <strong>RPN</strong> language used in the <strong>?DEF</strong> statements.
582 <a href="././rrdgraph_graph.html">the rrdgraph_graph manpage</a> page describes all of the graph and print functions.</p>
583 <p>Make sure to read <a href="././rrdgraph_examples.html">the rrdgraph_examples manpage</a> for tips&amp;tricks.</p>
584 <p>
585 </p>
586 <hr />
587 <h1><a name="author">AUTHOR</a></h1>
588 <p>Program by Tobias Oetiker &lt;<a href="mailto:tobi@oetiker.ch">tobi@oetiker.ch</a>&gt;</p>
589 <p>This manual page by Alex van den Bogaerdt &lt;<a href="mailto:alex@vandenbogaerdt.nl">alex@vandenbogaerdt.nl</a>&gt;
590 with corrections and/or additions by several people</p>
592 </body>
594 </html>