complete rewrite of rrdgraph documentation. This also includs info
[rrdtool.git] / doc / rrdgraph_graph.src
diff --git a/doc/rrdgraph_graph.src b/doc/rrdgraph_graph.src
new file mode 100644 (file)
index 0000000..44beac7
--- /dev/null
@@ -0,0 +1,222 @@
+=include name
+
+=head1 SYNOPSYS
+
+I<Depriciated commands>
+
+[B<PRINT:>I<vname>B<:>I<CF>B<:>I<format>]
+[B<GPRINT:>I<vname>B<:>I<CF>B<:>I<format>]
+[B<HRULE:>I<value>B<#>I<rrggbb>[B<:>I<legend>]]
+[B<STACK:>I<vname>[B<#>I<rrggbb>[B<:>I<legend>]]]
+
+I<available commands>
+
+[B<PRINT:>I<vname>B<:>I<format>]
+[B<GPRINT:>I<vname>B<:>I<format>]
+[B<COMMENT:>I<text>]
+[B<VRULE:>I<vname>B<#>I<rrggbb>[B<:>I<legend>]]
+[B<LINE>{B<1>|B<2>|B<3>}B<:>I<vname>[B<#>I<rrggbb>[B<:>I<legend>]]][B<:STACK>]
+[B<AREA:>I<vname>[B<#>I<rrggbb>[B<:>I<legend>]]][B<:STACK>]
+
+I<to be implemented commands>
+
+[B<SHIFT:>I<vname>]
+[B<PART:>I<vname>B<#>I<rrggbb>[B<:>I<legend>]]
+
+=head1 DESCRIPTION
+
+These instructions allow you to generate your image or report.
+If you don't use any graph elements, no graph is generated.
+Similarly no report is generated if you don't use print options.
+
+=head1 PRINT
+
+B<PRINT:>I<vname>B<:>I<CF>B<:>I<format>
+
+I<Depriciated. Use the new form of this command in new scripts.>
+The first form of this command is to be used with B<CDEF> I<vname>s.
+
+B<PRINT:>I<vname>B<:>I<format>
+
+Depending on the context, either the value component or the time
+component of a B<VDEF> is printed using I<format>. It is an error
+to specify a I<vname> generated by a B<DEF> or B<CDEF>.
+
+Any text in I<format> is printed literally with one exception:
+The percent character introduces a formatter string. This string
+can be:
+
+For printing values:
+
+=over 4
+
+=item *
+
+B<%%> just prints a literal '%' character
+
+=item *
+
+B<%#.#le> (where # is an optional number) prints like 1.2346e+04
+
+=item *
+
+B<%#.#lf> prints like 12345.6789
+
+=item *
+
+B<%s> place this after B<%le> or B<%lf>.  This will be replaced by the
+appropriate SI magnitude unit and the value will be scaled
+accordingly (123456 -> 123.456 k)
+
+=item *
+
+B<%S> is similar to B<%s>. It does however use a previously defined
+magnitude unit. If there is no such unit yet, it tries to define
+one (just like B<%s>). However, if the value is zero, the magnitude
+unit stays undefined. Thus, formatter strings using B<%S> and no B<%s>
+will all use the same magnitude unit except for zero values.
+
+=back
+
+For printing times:
+
+=over 4
+
+=item *
+
+B<%%> just prints a literal '%' character
+
+=item *
+
+B<%a, %A> prints abbreviated, full weekday name
+
+=item *
+
+B<%b, %B> prints abbreviated, full month name
+
+=item *
+
+B<%d, %m, %y, %H, %M, %S> day,month,year,hour,minute,second all in two-digit format
+
+=item *
+
+B<%Y> year in 4-digit format
+
+=item *
+
+B<%I, %p>  hour (01..12), 'am' or 'pm'
+
+=item *
+
+B<%j, %w> day of the week (0..6), day of the year (1..366)
+
+=item *
+
+B<%c, %x, %X> date+time, date, time
+
+=item *
+
+B<%U, %W> week number of the current year with either the first sunday or
+the first monday determining the first week
+
+=item *
+
+B<%Z> time zone
+
+=back
+
+=head1 GRAPH
+
+B<GPRINT:>I<vname>B<:>I<CF>B<:>I<format>
+
+I<Depriciated. Use the new form of this command in new scripts.>
+This is the same as B<PRINT> but now it is printed inside the graph.
+See L<PRINT> for more information.
+
+B<GPRINT:>I<vname>B<:>I<format>
+
+This is the same as B<PRINT> but now it is printed inside the graph.
+See L<PRINT> for more information.
+
+B<COMMENT:>I<text>
+
+Text is printed literally in the legend section of the graph
+
+B<HRULE:>I<value>B<#>I<rrggbb>[B<:>I<legend>]
+
+I<Depriciated. Use a VDEF and a LINEx in new scripts.>
+
+Draw an horizontal line at I<value>. Its color is composed from three
+hexadecimal numbers specifying the color components (00 is off, FF is
+maximum) red, green and blue.  Optionally a legend box and string is
+printed in the legend section.
+
+B<VRULE:>I<time>B<#>I<rrggbb>[B<:>I<legend>]
+
+Draw a vertical line at I<time>.  Its color is composed from three
+hexadecimal numbers specifying the color components (00 is off, FF is
+maximum) red, green and blue.  Optionally a legend box and string is
+printed in the legend section. I<time> may be a number or a variable
+from a B<VDEF>. It is an error to use I<vname>s from B<DEF> or B<CDEF> here.
+
+B<LINE>{B<1>|B<2>|B<3>}B<:>I<vname>[B<#>I<rrggbb>[B<:>I<legend>]][B<:STACK>]
+
+Draw a line of the specified width into the graph. If the color
+is not specified, the drawing is done 'blind'.  This is useful when
+stacking something else on top of this line. Also optional is the
+legend box and string which will be printed in the legend section
+if specified. The B<vname> can be generated by B<DEF>, B<VDEF> and
+B<CDEF>.  If the optional B<STACK> modifier is used, this line is
+stacked on top of the previous element which can be a B<LINEx> or
+an B<AREA>
+
+B<AREA:>I<vname>[B<#>I<rrggbb>[B<:>I<legend>]][B<:STACK>]
+
+See B<LINEx>, however the area between the x-axis and the line will
+also be filled.
+
+B<STACK:>I<vname>[B<#>I<rrggbb>[B<:>I<legend>]]
+
+I<Depriciated.  Use the B<STACK> modifiers on the other commands.>
+I<Note: the comments on stacking are still valid...>
+Repeats the last B<LINEx> or B<AREA> however it doesn't start at the
+x-axis but rather on top of the previous element. This implies that
+there needs to be something to stack on. An invisible B<LINEx> or
+B<AREA> is something you can stack on!
+
+Note: When you stack on something that was I<unknown>, the whole
+stack will be I<unknown> for that point in time. If the beginning
+is undefined, there's no way to end somewhere...  If you want to
+graph this stacked variable anyway you need to make sure that the
+B<LINEx> or B<AREA> it gets stacked on is not unknown. Use a CDEF
+instruction with B<IF> and B<UN> to do so.
+
+B<THE NEXT STUFF IS NOT YET IMPLEMENTED>
+
+B<SHIFT:>I<offset in seconds>
+
+Using this command B<RRDtool> will graph the following elements
+with the specified offset.  For instance, you can specify an
+offset of S<( 7*24*60*60 = ) 604800 seconds> to "look back" one
+week. Make sure to notify the viewer you did so...
+The offset will be valid until the next B<SHIFT> command, which
+can have an offset of zero to restore normal graphing.
+As with the other grapher elements, you can specify a number or
+a variable here.
+
+B<RRDtool> has now support for B<pie charts>. If you include the
+B<PART> command, the canvas is extended to make room for a chart
+(or, if no other graph elements are used, the canvas is solely
+used for the pie chart). The size of the canvas is determined by
+the lesser of L<width and height|rrdgraph/item_Size>.
+
+B<PART:>I<vname>B<#>I<rrggbb>[B<:>I<legend>]
+
+Draw a part of pie. Pie parts will be concatenated, the first one
+will start at the top and parts will be created clockwise.
+The size of the part is defined by the value part of
+the L<VDEF|rrdgraph_data/VDEF> function.  It should return
+a number between 0 and 100, being a percentage.
+Providing wrong input will produce undefined results.
+
+=include see_also