int res = 0;
double X0, Y0; /* points for filled graph and more */
struct gfx_color_t water_color;
+ int legend_cnt = 0;
if (im->draw_3d_border > 0) {
/* draw 3d border */
[TEXT_PROP_LEGEND].font_desc,
im->tabwidth, 0.0,
GFX_H_LEFT, GFX_V_BOTTOM, im->gdes[i].legend);
+ {
+ rrd_infoval_t val;
+ double w, h;
+
+ w = gfx_get_text_width(im, 0,
+ im->
+ text_prop
+ [TEXT_PROP_LEGEND].font_desc,
+ im->tabwidth, im->gdes[i].legend);
+ h = gfx_get_text_height(im, 0,
+ im->
+ text_prop
+ [TEXT_PROP_LEGEND].font_desc,
+ im->tabwidth, im->gdes[i].legend);
+
+ val.u_str = sprintf_alloc("%s", im->gdes[i].legend);
+ grinfo_push(im,
+ sprintf_alloc("legend[%ld]", legend_cnt),
+ RD_I_STR, val);
+ val.u_str = sprintf_alloc("%.0f,%.0f,%.0f,%.0f",
+ X0, Y0 - h, X0 + w, Y0);
+ grinfo_push(im,
+ sprintf_alloc("coords[%ld]", legend_cnt),
+ RD_I_STR, val);
+ legend_cnt++;
+ }
/* The legend for GRAPH items starts with "M " to have
enough space for the box */
if (im->gdes[i].gf != GF_PRINT &&
perl -p -e 's/([-+]?\d\.\d+e[-+]\d+)/sprintf("%0.7e",$1)/ge' | $DIFF $@
}
+BLANK=blank
+
+function blank {
+ perl -p -e 'm/(left|top|right|bottom|width|height|coords)/ && s/\d+/\#/g' $@
+}
+
#
# because valgrind has trouble with glib memory handling
# (see e.g. https://developer.gnome.org/glib/2.30/glib-running.html or
$RRDTOOL update $RRD 920807400:12405 920807700:12411 920808000:12415
$RRDTOOL update $RRD 920808300:12420 920808600:12422 920808900:12423
report "update"
-$RRDTOOL graphv - \
+# blank out any absolute coordinates, as they might differ
+$BLANK < $BASEDIR/rpn1.output > $BASEDIR/rpn1.output.out
+$RRDTOOL graphv $BASEDIR/rpn1.out \
--start 920804400 --end 920808000 \
DEF:my-speed=$RRD:speed:AVERAGE \
CDEF:nonans01=my-speed,UN,0,my-speed,IF \
VDEF:f=fast123456789012345678901234567890,AVERAGE \
VDEF:g=good,MAXIMUM \
VDEF:o=over,MINIMUM \
+ VRULE:920806500:"foo" \
PRINT:f:'%lf' \
PRINT:g:'%lf' \
- PRINT:o:'%lf' | $DIFF9 - $BASEDIR/rpn1.output
+ PRINT:o:'%lf' | $BLANK | $DIFF9 - $BASEDIR/rpn1.output.out
report "graphv"