RRDGRAPH(1)                         rrdtool                        RRDGRAPH(1)



[1mNAME[0m
       rrdtool graph - Create a graph based on data from one or several RRD

[1mSYNOPSIS[0m
       [1mrrdtool graph [4m[22mfilename[24m [[1m-s[22m|[1m--start [4m[22mseconds[24m] [[1m-e[22m|[1m--end [4m[22mseconds[24m]
       [[1m-x[22m|[1m--x-grid [4m[22mx-axis[24m [4mgrid[24m [4mand[24m [4mlabel[24m] [[1m-y[22m|[1m--y-grid [4m[22my-axis[24m [4mgrid[24m [4mand[24m [4mlabel[24m]
       [[1m-Y[22m|[1m--alt-y-grid[22m] [[1m-R[22m|[1m--alt-y-mrtg[22m] [[1m-A[22m|[1m--alt-autoscale[22m]
       [[1m-M[22m|[1m--alt-autoscale-max[22m] [[1m-N[22m|[1m--no-minor[22m] [[1m-X[22m|[1m--units-exponent[22m] [4mvalue[24m]>
       [[1m-v[22m|[1m--vertical-label [4m[22mtext[24m] [[1m-w[22m|[1m--width [4m[22mpixels[24m] [[1m-h[22m|[1m--height [4m[22mpixels[24m]
       [[1m-i[22m|[1m--interlaced[22m] [[1m-f[22m|[1m--imginfo [4m[22mformatstring[24m] [[1m-a[22m|[1m--imgfor-[0m
       [1mmat GIF[22m|[1mPNG[22m|[1mGD[22m] [[1m-B[22m|[1m--background [4m[22mvalue[24m] [[1m-O[22m|[1m--overlay [4m[22mvalue[24m]
       [[1m-U[22m|[1m--unit [4m[22mvalue[24m] [[1m-z[22m|[1m--lazy[22m] [[1m-o[22m|[1m--logarithmic[22m]
       [[1m-u[22m|[1m--upper-limit [4m[22mvalue[24m] [[1m-l[22m|[1m--lower-limit [4m[22mvalue[24m] [[1m-g[22m|[1m--no-legend[22m]
       [[1m-r[22m|[1m--rigid[22m] [[1m-S[22m|[1m--step [4m[22mvalue[24m] [[1m-b[22m|[1m--base [4m[22mvalue[24m] [[1m-c[22m|[1m--color [4m[22mCOL-[0m
       [4mORTAG[24m[1m#[4m[22mrrggbb[24m] [[1m-t[22m|[1m--title [4m[22mtitle[24m] [[1mDEF:[4m[22mvname[24m[1m=[4m[22mrrd[24m[1m:[4m[22mds-name[24m[1m:[4m[22mCF[24m]
       [[1mCDEF:[4m[22mvname[24m[1m=[4m[22mrpn-expression[24m] [[1mPRINT:[4m[22mvname[24m[1m:[4m[22mCF[24m[1m:[4m[22mformat[24m]
       [[1mGPRINT:[4m[22mvname[24m[1m:[4m[22mCF[24m[1m:[4m[22mformat[24m] [[1mCOMMENT:[4m[22mtext[24m] [[1mHRULE:[4m[22mvalue[24m[1m#[4m[22mrrggbb[24m[[1m:[4m[22mlegend[24m]]
       [[1mVRULE:[4m[22mtime[24m[1m#[4m[22mrrggbb[24m[[1m:[4m[22mlegend[24m]] [[1mLINE[22m{[1m1[22m|[1m2[22m|[1m3[22m}[1m:[4m[22mvname[24m[[1m#[4m[22mrrggbb[24m[[1m:[4m[22mlegend[24m]]]
       [[1mAREA:[4m[22mvname[24m[[1m#[4m[22mrrggbb[24m[[1m:[4m[22mlegend[24m]]] [[1mSTACK:[4m[22mvname[24m[[1m#[4m[22mrrggbb[24m[[1m:[4m[22mlegend[24m]]]

[1mDESCRIPTION[0m
       The [1mgraph [22mfunctions main purpose is to create graphical representations
       of the data stored in one or several [1mRRD[22ms. Apart from generating
       graphs, it can also extract numerical reports.

       [4mfilename[0m
           The name of the graph to generate. Since [1mrrdtool [22moutputs GIFs and
           PNGs, it's recommended that the filename end in either [4m.gif[24m or
           [4m.png[24m.  [1mrrdtool [22mdoes not enforce this, however.  If the  [4mfilename[24m is
           set to '-' the image file will be written to standard out.  All
           other output will get suppressed.

           PNG output is recommended, since it takes up to 40% less disk space
           and 20-30% less time to generate than a GIF file.

           If no graph functions are called, the graph will not be created.

       [1m-s[22m|[1m--start [4m[22mseconds[24m (default end-1day)
           The time when the graph should begin. Time in seconds since epoch
           (1970-01-01) is required. Negative numbers are relative to the cur-
           rent time. By default one day worth of data will be graphed.  See
           also AT-STYLE TIME SPECIFICATION section in the [4mrrdfetch[24m documenta-
           tion for a detailed explanation on how to specify time.

       [1m-e[22m|[1m--end [4m[22mseconds[24m (default now)
           The time when the graph should end. Time in seconds since epoch.
           See also AT-STYLE TIME SPECIFICATION section in the [4mrrdfetch[24m docu-
           mentation for a detailed explanation of ways to specify time.

       [1m-x[22m|[1m--x-grid [4m[22mx-axis[24m [4mgrid[24m [4mand[24m [4mlabel[24m (default autoconfigure)
           The x-axis label is quite complex to configure. So if you don't
           have very special needs, you can rely on the autoconfiguration to
           get this right.

           If you want no x-grid at all, use the magic setting [1mnone[22m.

           The x-axis label and grid can be configured, using the following
           format:

           [4mGTM[24m[1m:[4m[22mGST[24m[1m:[4m[22mMTM[24m[1m:[4m[22mMST[24m[1m:[4m[22mLTM[24m:[4mLST[24m[1m:[4m[22mLPR[24m[1m:[4m[22mLFM[0m

           You have to configure three elements making up the x-axis labels
           and grid. The base grid ([4mG??[24m), the major grid ([4mM??[24m) and the labels
           ([4mL??[24m). The configuration is based on the idea that you first spec-
           ify a well known amount of time ([4m?TM[24m) and then say how many times
           it has to pass between each grid line or label ([4m?ST[24m). For the label
           you have to define two additional items: The precision of the label
           in seconds ([4mLPR[24m) and the strftime format used to generate the text
           of the label ([4mLFM[24m).

           The [4m?TM[24m elements must be one of the following keywords: [1mSECOND[22m,
           [1mMINUTE[22m, [1mHOUR[22m, [1mDAY[22m, [1mWEEK[22m, [1mMONTH [22mor [1mYEAR[22m.

           If you wanted a graph with a base grid every 10 minutes and a major
           one every hour, with labels every hour you would use the following
           x-axis definition.

           "MINUTE:10:HOUR:1:HOUR:1:0:%X"

           The precision in this example is 0 because the %X format is exact.
           If the label was the name of the day, we would have had a precision
           of 24 hours, because when you say something like 'Monday' you mean
           the whole day and not Monday morning 00:00. Thus the label should
           be positioned at noon. By defining a precision of 24 hours or
           rather 86400 seconds, you make sure that this happens.

           If you want to alter the genertated text to another language, use
           the LC_TIME environment variable to set the locale you prefere
           prior to calling the graph function.

       [1m-y[22m|[1m--y-grid [4m[22mgrid[24m [4mstep[24m:[4mlabel[24m [4mfactor[24m (default autoconfigure)
           Makes vertical grid lines appear at [4mgrid[24m [4mstep[24m interval. Every [4mlabel[0m
           [4mfactor[24m gridstep, a major grid line is printed, along with label
           showing the value of the grid line.

           If you want no y-grid at all set specify the magic word [1mnone[22m.

       [1m-Y[22m|[1m--alt-y-grid[0m
           Place Y grid dynamically based on graph Y range. Algorithm ensures
           that you always have grid, that there are enough but not too many
           grid lines and the grid is metric. That is grid lines are placed
           every 1, 2, 5 or 10 units.  (contributed by Sasha Mikheev)

       [1m--no-minor[0m
           Turn off the minor grid lines.  This is partcularly useful for
           small graphs which can be cluttered with the minor grid lines.
           (contributed by Travis Brown)

       [1m-R[22m|[1m--alt-y-mrtg[0m
           Y grid placed on graph Y range mimmics mrtg's (rateup-generated)
           graphs.  Currently axis is split into 4 parts, just as rateup does.

       [1m-A[22m|[1m--alt-autoscale[0m
           Compute Y range  based on function absolute minimum and maximum
           values. Default algorithm uses predefined set of ranges.  This is
           good in many cases but it fails miserably when you need to graph
           something like 260 + 0.001 * sin(x). Default algorithm will use Y
           range from 250 to 300 and on the graph you will see almost straight
           line. With --alt-autoscale Y range will be from slightly less the
           260 - 0.001 to slightly more then 260 + 0.001 and periodic behavior
           will be seen.   (contributed by Sasha Mikheev)

       [1m-M[22m|[1m--alt-autoscale-max[0m
           Where --alt-autoscale will modify both the absolute maximum AND
           minimum values, this option will only affect the maximum value. The
           minimum value, if not defined on the command line, will be 0. This
           option can be useful when graphing router traffic when the WAN line
           uses compression, and thus the throughput may be higher than the
           WAN line speed.

       [1m-X[22m|[1m--units-exponent [4m[22mvalue[24m (default autoconfigure)
           This sets the 10**exponent scaling of the y-axis values.  Normally
           values will be scaled to the appropriate units (k, M, etc.).  How-
           ever you may wish to display units always in k (Kilo, 10e3) even if
           the data is in the M (Mega, 10e6) range for instance.  Value should
           be an integer which is a multiple of 3 between -18 and 18 inclu-
           sive.  It is the exponent on the units you which to use.  For exam-
           ple, use 3 to display the y-axis values in k (Kilo, 10e3, thou-
           sands), use -6 to display the y-axis values in u (Micro, 10e-6,
           millionths).  Use a value of 0 to prevent any scaling of the y-axis
           values.

       [1m-v[22m|[1m--vertical-label [4m[22mtext[0m
           vertical label on the left side of the graph. This is normally used
           to specify the units used.

       [1m-w[22m|[1m--width [4m[22mpixels[24m (default 400 pixel)
           Width of the drawing area within the graph. This affects the size
           of the gif.

       [1m-h[22m|[1m--height [4m[22mpixels[24m (default 100 pixel)
           Width of the drawing area within the graph. This affects the size
           of the gif.

       [1m-i[22m|[1m--interlaced [22m(default: false)
           If you set this option, then the resulting GIF will be interlaced.
           Most web browsers display these incrementally as they load. If you
           do not use this option, the GIFs default to being progressive
           scanned. The only effect of this option is to control the format of
           the GIF on disk. It makes no changes to the layout or contents of
           the graph.

       [1m-f[22m|[1m--imginfo [4m[22mformatstring[0m
           After the image has been created, the graph function uses printf
           together with this format string to create output similar to the
           PRINT function, only that the printf is supplied with the parame-
           ters [4mfilename[24m, [4mxsize[24m and [4mysize[24m. In order to generate an [1mIMG [22mtag
           suitable for including the graph into a web page, the command line
           would look like this:

            --imginfo '<IMG SRC="/img/%s" WIDTH="%lu" HEIGHT="%lu" ALT="Demo">'

       [1m-a[22m|[1m--imgformat GIF[22m|[1mPNG[22m|[1mGD [22m(default: GIF)
           Allows you to produce PNG or GD output from rrdtool.

       [1m-B[22m|[1m--background [4m[22mvalue[0m
           You could use image in (currently only) GD format for background.
           It is used as background at the very beginning of graph creation.

       [1m-O[22m|[1m--overlay [4m[22mvalue[0m
           You could use image in (currently only) GD format as overlay. It is
           placed over created graph so that white pixel (color 255,255,255)
           is considered transparent, all other is replacing corresponding
           pixel in created graph.

       [1m-U[22m|[1m--unit [4m[22mvalue[0m
           You could use unit to be displayed on y axis. It is wise to use
           only short units on graph, however.

       [1m-z[22m|[1m--lazy [22m(default: false)
           Only generate the graph, if the current gif is out of date or not
           existent.

       [1m-u[22m|[1m--upper-limit [4m[22mvalue[24m (default autoconfigure)
           Defines the value normally located at the upper border of the
           graph. If the graph contains higher values, the upper border will
           move upwards to accomodate these values as well.

           If you want to define an upper-limit which will not move in any
           event you have to set the [1m--rigid [22moption as well.

       [1m-l[22m|[1m--lower-limit [4m[22mvalue[24m (default autoconfigure)
           This is not the lower limit of a graph.  But rather, this is the
           maximum lower bound of a graph.  For example, the value -100 will
           result in a graph that has a lower limit of -100 or less.  Use this
           keyword to expand graphs down.

       [1m-r[22m|[1m--rigid[0m
           rigid boundaries mode.  Normally rrdgraph will automatically expand
           the lower and upper limit if the graph contains a value outside the
           valid range. With the r option you can disable this behavior

       [1m-b[22m|[1m--base [4m[22mvalue[0m
           if you are graphing memory (and NOT network traffic) this switch
           should be set to 1024 so that one Kb is 1024 byte. For traffic mea-
           surement, 1 kb/s is 1000 b/s.

       [1m-o[22m|[1m--logarithmic[0m
           logarithmic y-axis scaling

       [1m-c[22m|[1m--color [4m[22mCOLORTAG[24m[1m#[4m[22mrrggbb[24m (default colors)
           override the colors for the standard elements of the graph. The
           [4mCOLORTAG[24m must be one of the following symbolic names: [1mBACK [22mground,
           [1mCANVAS[22m, [1mSHADEA [22mleft/top border, [1mSHADEB [22mright/bottom border, [1mGRID[22m,
           [1mMGRID [22mmajor grid, [1mFONT[22m, [1mFRAME [22mand axis of the graph or [1mARROW[22m. This
           option can be called multiple times to set several colors.

       [1m-g[22m|[1m--no-legend[0m
           Suppress generation of legend; only render the graph.

       [1m-t[22m|[1m--title [4m[22mtext[24m (default no title)
           Define a title to be written into the graph

       [1m-S[22m|[1m--step [4m[22mvalue[24m (default automatic)
           By default rrdgraph calculates the width of one pixel in the time
           domain and tries to get data at that resolution from the RRD. With
           this switch you can override this behaviour. If you want rrdgraph
           to get data at 1 hour resolution from the RRD, then you can set the
           step to 3600 seconds. Note, that a step smaller than 1 pixel will
           be silently ignored.

       [1mDEF:[4m[22mvname[24m[1m=[4m[22mrrd[24m[1m:[4m[22mds-name[24m[1m:[4m[22mCF[0m
           Define virtual name for a data source. This name can then be used
           in the functions explained below. The DEF call automatically
           chooses an [1mRRA [22mwhich contains [4mCF[24m consolidated data in a resolution
           appropriate for the size of the graph to be drawn.  Ideally this
           means that one data point from the [1mRRA [22mshould be represented by one
           pixel in the graph.  If the resolution of the [1mRRA [22mis higher than
           the resolution of the graph, the data in the RRA will be further
           consolidated according to the consolidation function ([4mCF[24m) chosen.

       [1mCDEF:[4m[22mvname[24m[1m=[4m[22mrpn-expression[0m
           Create a new virtual data source by evaluating a mathematical
           expression, specified in Reverse Polish Notation (RPN). If you have
           ever used a traditional HP calculator you already know RPN. The
           idea behind RPN notation is, that you have a stack and push your
           data onto this stack. When ever you execute an operation, it takes
           as many data values from the stack as needed. The pushing of data
           is implicit, so when ever you specify a number or a variable, it
           gets pushed automatically.

           If this is all a big load of incomprehensible words for you, maybe
           an example helps (a more complete explanation is given in [1]): The
           expression [4mvname+3/2[24m becomes "vname,3,2,/,+" in RPN. First the
           three values get pushed onto the stack (which now contains (the
           current value of) vname, a 3 and a 2).  Then the / operator pops
           two values from the stack (3 and 2), divides the first argument by
           the second (3/2) and pushes the result (1.5) back onto the stack.
           Then the + operator pops two values (vname and 1.5) from the stack;
           both values are added up and the result gets pushes back onto the
           stack. In the end there is only one value left on the stack: The
           result of the expression.

           The [4mrpn-expression[24m in the [1mCDEF [22mfunction takes both, constant values
           as well as [4mvname[24m variables. The following operators can be used on
           these values:

           +, -, *, /, %
               pops two values from the stack applies the selected operator
               and pushes the result back onto the stack. The % operator
               stands for the modulo operation.

           SIN, COS, LOG, EXP, FLOOR, CEIL
               pops one value from the stack, applies the selected function
               and pushes the result back onto the stack.

           LT, LE, GT, GE, EQ
               pops two values from the stack, compares them according to the
               selected condition and pushes either 1 back onto the stack if
               the condition is true and 0 if the condition was not true.

           IF  pops three values from the stack. If the last value is not 0,
               the second value will be pushed back onto the stack, otherwise
               the first value is pushed back.

               If the stack contains the values A, B, C, D, E are presently on
               the stack, the IF operator will pop the values E D and C of the
               stack. It will look at C and if it is not 0 it will push D back
               onto the stack, otherwise E will be sent back to the stack.

           MIN, MAX
               selects the lesser or larger of the two top stack values
               respectively

           LIMIT
               replaces the value with [4m*UNKNOWN*[24m if it is outside the limits
               specified by the two values above it on the stack.

                CDEF:a=alpha,0,100,LIMIT

           DUP, EXC, POP
               These manipulate the stack directly.  DUP will duplicate the
               top of the stack, pushing the result back onto the stack.  EXC
               will exchange the top two elements of the stack, and POP will
               pop off the top element of the stack.  Having insufficient ele-
               ments on the stack for these operations is an error.

           UN  Pops one value off the stack, if it is [4m*UNKNOWN*[24m, 1 will be
               pushed back otherwise 0.

           UNKN
               Push an [4m*UNKNOWN*[24m value onto the stack.

           PREV
               Push [4m*UNKNOWN*[24m if its at the first value of a data set or oth-
               erwise the value of this CDEF at the previous time step. This
               allows you to perform calculations across the data.

           PREV(vname)
               Push [4m*UNKNOWN*[24m if its at the first value of the data set named
               vname or otherwise the value of the CDEF named vname at the
               previous time step.  This allows you to perform complex
               calculations across the data.

           INF, NEGINF
               Push a positive or negative infinite (oo) value onto the stack.
               When drawing an infinite number it appears right at the top or
               bottom edge of the graph, depending whether you have a positive
               or negative infinite number.

           NOW Push the current (real world) time onto the stack.

           TIME
               Push the time the current sample was taken onto the stack. This
               is the number of non-skip seconds since 0:00:00 January 1,
               1970.

           LTIME
               This is like TIME [1m+ current timezone offset in seconds[22m. The
               current offset takes daylight saving time into account, given
               your OS supports this. If you were looking at a sample, in
               Zurich, in summer, the offset would be 2*3600 seconds, as
               Zurich at that time of year is 2 hours ahead of UTC.

               Note that the timezone offset is always calculated for the time
               the current sample was taken at. It has nuthing todo with the
               time you are doing the calculation.

           Please note that you may only use [4mvname[24m variables that you previ-
           ously defined by either [1mDEF [22mor [1mCDEF[22m. Furthermore, as of this writ-
           ing (version 0.99.25), you must use at least one [4mvname[24m per expres-
           sion, that is "CDEF:fourtytwo=2,40,+" will yield an error message
           but not a [4mvname[24m fourtytwo that's always equal to 42.

       [1mPRINT:[4m[22mvname[24m[1m:[4m[22mCF[24m[1m:[4m[22mformat[0m
           Calculate the chosen consolidation function [4mCF[24m over the data-source
           variable [4mvname[24m and "printf" the result to stdout using [4mformat[24m.  In
           the [4mformat[24m string there should be a '%lf'or '%le' marker in the
           place where the number should be printed.

           If an additional '%s' is found AFTER the marker, the value will be
           scaled and an appropriate SI magnitude unit will be printed in
           place of the '%s' marker. The scaling will take the '--base' argu-
           ment into consideration!

           If a '%S' is used instead of a '%s', then instead of calculating
           the appropriate SI magnitude unit for this value, the previously
           calculated SI magnitude unit will be used.  This is useful if you
           want all the values in a PRINT statement to have the same SI magni-
           tude unit.  If there was no previous SI magnitude calculation made,
           then '%S' behaves like a '%s', unless the value is 0, in which case
           it does not remember a SI magnitude unit and a SI magnitude unit
           will only be calculated when the next '%s' is seen or the next '%S'
           for a non-zero value.

           If you want to put a '%' into your PRINT string, use '%%' instead.

       [1mGPRINT:[4m[22mvname[24m[1m:[4m[22mCF[24m[1m:[4m[22mformat[0m
           Same as [1mPRINT [22mbut the result is printed into the graph below the
           legend.

       [1mCaveat: [22mWhen using the [1mPRINT [22mand [1mGRPRINT [22mfunctions to calculate data
       summaries over time periods bounded by the current time, it is impor-
       tant to note that the last sample will almost always yield a value of
       UNKNOWN as it lies after the last update time.  This can result in
       slight data skewing, particularly with the [1mAVERAGE [22mfunction.  In order
       to avoid this, make sure that your end time is at least one heartbeat
       prior to the current time.

       [1mCOMMENT:[4m[22mtext[0m
           Like [1mGPRINT [22mbut the [4mtext[24m is simply printed into the graph.

       [1mHRULE:[4m[22mvalue[24m[1m#[4m[22mrrggbb[24m[[1m:[4m[22mlegend[24m]
           Draw a horizontal rule into the graph and optionally add a legend

       [1mVRULE:[4m[22mtime[24m[1m#[4m[22mrrggbb[24m[[1m:[4m[22mlegend[24m]
           Draw a vertical rule into the graph and optionally add a legend

       [1mLINE[22m{[1m1[22m|[1m2[22m|[1m3[22m}[1m:[4m[22mvname[24m[[1m#[4m[22mrrggbb[24m[[1m:[4m[22mlegend[24m]]
           Plot for the requested data, using the color specified. Write a
           legend into the graph. The 3 possible keywords [1mLINE1[22m, [1mLINE2[22m, and
           [1mLINE3 [22mgenerate increasingly wide lines. If no color is defined, the
           drawing is done 'blind' this is useful in connection with the [1mSTACK[0m
           function when you want to ADD the values of two data-sources with-
           out showing it in the graph.

       [1mAREA[22m:[4mvname[24m[[1m#[4m[22mrrggbb[24m[[1m:[4m[22mlegend[24m]]
           Does the same as [1mLINE?[22m, but the area between 0 and the graph will
           be filled with the color specified.

       [1mSTACK[22m:[4mvname[24m[[1m#[4m[22mrrggbb[24m[[1m:[4m[22mlegend[24m]]
           Does the same as [1mLINE?[22m, but the graph gets stacked on top of the
           previous [1mLINE?[22m, [1mAREA [22mor [1mSTACK [22mgraph. Depending on the type of the
           previous graph, the [1mSTACK [22mwill be either a [1mLINE? [22mor an [1mAREA[22m.  This
           obviously implies that the first [1mSTACK [22mmust be preceded by an [1mAREA[0m
           or [1mLINE? [22m-- you need something to stack something onto in the first
           place ;)

           Note, that when you STACK onto *UNKNOWN* data, rrdtool will not
           draw any graphics ... *UNKNOWN* is not zero ... if you want it to
           zero then you might want to use a CDEF argument with IF and UN
           functions to turn *UNKNOWN* into zero ...

[1mNOTES on legend arguments[0m
       [1mEscaping the colon[0m

       In a ':' in a [4mlegend[24m argument will mark the end of the legend. To enter
       a ':' into a legend, the colon must be escaped with a backslash '\:'.
       Beware, that many environments look for backslashes themselves, so it
       may be necessary to write two backslashes so that one is passed onto
       rrd_graph.

       [1mString Formatting[0m

       The text printed below the actual graph can be formated by appending
       special escaped characters at the end of a text. When ever such a char-
       acter occurs, all pending text is pushed onto the graph according to
       the character specified.

       Valid markers are: [1m\j [22mfor justified, [1m\l [22mfor left aligned, [1m\r [22mfor right
       aligned and [1m\c [22mfor centered. In the next section there is an example
       showing how to use centered formating.

       Normally there are two space characters inserted between every two
       items printed into the graph. The space following a string can be sup-
       pressed by putting a [1m\g [22mat the end of the string. The [1m\g [22malso squshes
       any space inside the string if it is at the very end of the string.
       This can be used in connection with [1m%s [22mto supress empty unit strings.

        GPRINT:a:MAX:%lf%s\g

       A special case is COMMENT:[1m\s [22mthis inserts some additional vertical
       space before placing the next row of legends.

       When text has to be formated without special instructions from your
       side, rrdtool will automatically justify the text as soon as one string
       goes over the right edge. If you want to prevent the justification
       without forcing a newline, you can use the special tag [1m\J [22mat the end of
       the string to disable the auto justification.

[1mNOTE on Return Values[0m
       Whenever rrd_graph gets called, it prints a line telling the size of
       the gif it has just created to STDOUT. This line looks like this:
       XSIZExYSIZE.

[1mEXAMPLE 1[0m
         rrdtool graph demo.gif --title="Demo Graph" \
                 DEF:cel=demo.rrd:exhaust:AVERAGE \
                 "CDEF:far=cel,1.8,*,32,+"" \
                 LINE2:cel#00a000:"D. Celsius" \
                 LINE2:far#ff0000:"D. Fahrenheit\c"

[1mEXAMPLE 2[0m
       This example demonstrates the syntax for using IF and UN to set
       [4m*UNKNOWN*[24m values to 0.  This technique is useful if you are aggregating
       interface data where the start dates of the data sets doesn't match.

         rrdtool graph demo.gif --title="Demo Graph" \
                DEF:idat1=interface1.rrd:ds0:AVERAGE \
                DEF:idat2=interface2.rrd:ds0:AVERAGE \
                DEF:odat1=interface1.rrd:ds1:AVERAGE \
                DEF:odat2=interface2.rrd:ds1:AVERAGE \
                CDEF:agginput=idat1,UN,0,idat1,IF,idat2,UN,0,idat2,IF,+,8,* \
                CDEF:aggoutput=odat1,UN,0,odat1,IF,odat2,UN,0,odat2,IF,+,8,* \
                AREA:agginput#00cc00:Input Aggregate \
                LINE1:aggoutput#0000FF:Output Aggregate

       Assuming that idat1 has a data value of [4m*UNKNOWN*[24m, the CDEF expression

        idat1,UN,0,idat1,IF

       leaves us with a stack with contents of 1,0,NaN and the IF function
       will pop off the 3 values and replace them with 0.  If idat1 had a real
       value like 7942099, then the stack would have 0,0,7942099 and the real
       value would be the replacement.

[1mEXAMPLE 3[0m
       This example shows two ways to use the INF function. First it makes the
       background change color during half of the hours. Then, it uses AREA
       and STACK to draw a picture. If one of the inputs was UNKNOWN, all
       inputs are overlaid with another AREA.

         rrdtool graph example.png --title="INF demo" \
                DEF:val1=some.rrd:ds0:AVERAGE \
                DEF:val2=some.rrd:ds1:AVERAGE \
                DEF:val3=some.rrd:ds2:AVERAGE \
                DEF:val4=other.rrd:ds0:AVERAGE \
                CDEF:background=val4,POP,TIME,7200,%,3600,LE,INF,UNKN,IF \
                CDEF:wipeout=val1,val2,val3,val4,+,+,+,UN,INF,UNKN,IF \
                AREA:background#F0F0F0 \
                AREA:val1#0000FF:Value1 \
                STACK:val2#00C000:Value2 \
                STACK:val3#FFFF00:Value3 \
                STACK:val4#FFC000:Value4 \
                AREA:wipeout#FF0000:Unknown

       The first CDEF uses val4 as a dummy value. It's value is removed imme-
       diately from the stack. Then a decision is made based on the time that
       a sample was taken. If it is an even hour (UTC time !) then the area
       will be filled. If it is not, the value is set to UNKN and is not plot-
       ted.

       The second CDEF looks if any of val1,val2,val3,val4 is unknown. It does
       so by checking the outcome of sum(val1,val2,val3,val4). Again, INF is
       returned when the condition is true, UNKN is used to not plot the data.

       The different items are plotted in a particular order. First do the
       background, then use a normal area to overlay it with data. Stack the
       other data until they are all plotted. Last but not least, overlay
       everything with eye-hurting red to signal any unknown data.

       Note that this example assumes that your data is in the positive half
       of the y-axis otherwhise you would would have to add NEGINF in order to
       extend the coverage of the rea to whole graph.

[1mAUTHOR[0m
       Tobias Oetiker <oetiker@ee.ethz.ch>

[1mREFERENCES[0m
       [1] http://www.dotpoint.com/xnumber/rpn_or_adl.htm



1.0.41                            2003-02-16                       RRDGRAPH(1)
