Code

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