]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Normally the graphing function makes sure that the entire LINE or AREA
authorTobias Oetiker <tobi@oetiker.ch>
Wed, 14 Nov 2012 13:19:44 +0000 (14:19 +0100)
committerTobias Oetiker <tobi@oetiker.ch>
Wed, 14 Nov 2012 13:19:44 +0000 (14:19 +0100)
is visible in the chart. The scaling of the chart will be modified
accordingly if necessary. Any LINE or AREA can be excluded from this
process by adding the option SKIPSCALE.

 LINE:x#f00::SKIPSCALE

doc/rrdgraph_graph.pod
src/rrd_graph.c
src/rrd_graph.h
src/rrd_graph_helper.c

index 56a774a07ec9fb84e7eb3ea62401173eb2a0664c..f138d10406bcae99f650ab9456c19b5b8ce5a554 100644 (file)
@@ -16,9 +16,9 @@ B<VRULE>B<:>I<time>B<#>I<color>[B<:>I<legend>][B<:dashes>[B<=>I<on_s>[,I<off_s>[
 
 B<HRULE>B<:>I<value>B<#>I<color>[B<:>I<legend>][B<:dashes>[B<=>I<on_s>[,I<off_s>[,I<on_s>,I<off_s>]...]][B<:dash-offset=>I<offset>]]
 
-B<LINE>[I<width>]B<:>I<value>[B<#>I<color>][B<:>[I<legend>][B<:STACK>]][B<:dashes>[B<=>I<on_s>[,I<off_s>[,I<on_s>,I<off_s>]...]][B<:dash-offset=>I<offset>]]
+B<LINE>[I<width>]B<:>I<value>[B<#>I<color>][B<:>[I<legend>][B<:STACK>][B<:SKIPSCALE>][B<:dashes>[B<=>I<on_s>[,I<off_s>[,I<on_s>,I<off_s>]...]][B<:dash-offset=>I<offset>]]
 
-B<AREA>B<:>I<value>[B<#>I<color>][B<:>[I<legend>][B<:STACK>]]
+B<AREA>B<:>I<value>[B<#>I<color>][B<:>[I<legend>][B<:STACK>][B<:SKIPSCALE>]]
 
 B<TICK>B<:>I<vname>B<#>I<rrggbb>[I<aa>][B<:>I<fraction>[B<:>I<legend>]]
 
@@ -235,7 +235,7 @@ Draw a horizontal line at I<value>.  HRULE acts much like LINE except that
 will have no effect on the scale of the graph. If a HRULE is outside the
 graphing area it will just not be visible.
 
-=head3 B<LINE>[I<width>]B<:>I<value>[B<#>I<color>][B<:>[I<legend>][B<:STACK>]][B<:dashes>[B<=>I<on_s>[,I<off_s>[,I<on_s>,I<off_s>]...]][B<:dash-offset=>I<offset>]]
+=head3 B<LINE>[I<width>]B<:>I<value>[B<#>I<color>][B<:>[I<legend>][B<:STACK>][B<:SKIPSCALE>]][B<:dashes>[B<=>I<on_s>[,I<off_s>[,I<on_s>,I<off_s>]...]][B<:dash-offset=>I<offset>]]
 
 Draw a line of the specified width onto the graph. I<width> can be a
 floating point number. If the color is not specified, the drawing is done
@@ -246,6 +246,11 @@ 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<LINE> or an
 B<AREA>.
 
+Normally the graphing function makes sure that the entire B<LINE> or B<AREA>
+is visible in the chart. The scaling of the chart will be modified
+accordingly if necessary. Any B<LINE> or B<AREA> can be excluded from this
+process by adding the option B<SKIPSCALE>.
+
 The B<dashes> modifier enables dashed line style. Without any further options
 a symmetric dashed line with a segment length of 5 pixels will be drawn. The
 dash pattern can be changed if the B<dashes=> parameter is followed by either
@@ -255,9 +260,10 @@ stroke. The B<dash-offset> parameter specifies an I<offset> into the pattern
 at which the stroke begins.
 
 When you do not specify a color, you cannot specify a legend.  Should
-you want to use STACK, use the "LINEx:<value>::STACK" form.
+you want to use B<STACK>, use the "LINEx:<value>::STACK" form.
+
 
-=head3 B<AREA>B<:>I<value>[B<#>I<color>][B<:>[I<legend>][B<:STACK>]]
+=head3 B<AREA>B<:>I<value>[B<#>I<color>][B<:>[I<legend>][B<:STACK>][B<:SKIPSCALE>]]
 
 See B<LINE>, however the area between the x-axis and the line will
 be filled.
index 9a262ca1fda6debbfafe34e8c3cd83551836a1ce..c0f6181531b6d5f45f819cc2109250f21f6a7480 100644 (file)
@@ -1290,7 +1290,7 @@ int data_proc(
                     /* GF_TICK: the data values are not
                      ** relevant for min and max
                      */
-                    if (finite(paintval) && im->gdes[ii].gf != GF_TICK) {
+                    if (finite(paintval) && im->gdes[ii].gf != GF_TICK && !im->gdes[ii].ignore_for_scaling) {
                         if ((isnan(minval) || paintval < minval) &&
                             !(im->logarithmic && paintval <= 0.0))
                             minval = paintval;
@@ -3820,6 +3820,7 @@ int gdes_alloc(
     im->gdes[im->gdes_c - 1].step = im->step;
     im->gdes[im->gdes_c - 1].step_orig = im->step;
     im->gdes[im->gdes_c - 1].stack = 0;
+    im->gdes[im->gdes_c - 1].ignore_for_scaling = 0;
     im->gdes[im->gdes_c - 1].linewidth = 0;
     im->gdes[im->gdes_c - 1].debug = 0;
     im->gdes[im->gdes_c - 1].start = im->start;
index 525e01964008d7532659dde68dd798da181da0c4..03c81f0c129822770a55b012eddead828e1c927f 100644 (file)
@@ -159,6 +159,7 @@ typedef struct graph_desc_t {
     enum gf_en gf;      /* graphing function */
     int       stack;    /* boolean */
     int       debug;    /* boolean */
+    int       ignore_for_scaling; /* boolean */
     char      vname[MAX_VNAME_LEN + 1]; /* name of the variable */
     long      vidx;     /* gdes reference */
     char      rrd[1024];    /* name of the rrd_file containing data */
@@ -199,6 +200,7 @@ typedef struct graph_desc_t {
     int       ndash;    /* number of dash segments */
     double    offset;   /* dash offset along the line */
 
+
     enum txa_en txtalign;   /* change default alignment strategy for text */
 } graph_desc_t;
 
index 00922a5e122f92fa26f6b63edb39152ade30876c..7779de0ce06fa9d1ad9c9f877dcceb12b64a49f0 100644 (file)
@@ -758,6 +758,24 @@ int rrd_parse_PVHLAST(
             dprintf("- not STACKing\n");
     }
 
+    dprintf("- parsing '%s', looking for SKIPSCALE\n", &line[*eaten]);
+    j = scan_for_col(&line[*eaten], 9, tmpstr);
+    if (!strcmp("SKIPSCALE", tmpstr)) {
+        dprintf("- found SKIPSCALE\n");
+        gdp->ignore_for_scaling = 1;
+        (*eaten) += j;
+        if (line[*eaten] == ':') {
+            (*eaten) += 1;
+        } else if (line[*eaten] == '\0') {
+            dprintf("- done parsing line\n");
+            return 0;
+        } else {
+            dprintf("- found %s instead of just SKIPSCALE\n", &line[*eaten]);
+            rrd_set_error("SKIPSCALE expected but %s found", &line[*eaten]);
+            return 1;
+        }
+    }
+
     dprintf("- still more, should be dashes[=...]\n");
     dprintf("- parsing '%s'\n", &line[*eaten]);
     if (line[*eaten] != '\0') {