int Xvertical = 0, Ytitle =
0, Xylabel = 0, Xmain = 0, Ymain =
0, Yxlabel = 0, Xspacing = 15, Yspacing = 15, Ywatermark = 4;
- infoval info;
if (im->extra_flags & ONLY_GRAPH) {
im->xorigin = 0;
}
ytr(im, DNAN);
- info.u_cnt = im->xorigin;
- grinfo_push(im, sprintf_alloc("graph_left"), RD_I_CNT, info);
- info.u_cnt = im->yorigin - Ymain;
- grinfo_push(im, sprintf_alloc("graph_top"), RD_I_CNT, info);
- info.u_cnt = im->xsize;
- grinfo_push(im, sprintf_alloc("graph_width"), RD_I_CNT, info);
- info.u_cnt = im->ysize;
- grinfo_push(im, sprintf_alloc("graph_height"), RD_I_CNT, info);
- info.u_cnt = im->ximg;
- grinfo_push(im, sprintf_alloc("image_width"), RD_I_CNT, info);
- info.u_cnt = im->yimg;
- grinfo_push(im, sprintf_alloc("image_height"), RD_I_CNT, info);
return 0;
}
**************************************************************/
if (graph_size_location(im, i) == -1)
return -1;
+
+ info.u_cnt = im->xorigin;
+ grinfo_push(im, sprintf_alloc("graph_left"), RD_I_CNT, info);
+ info.u_cnt = im->yorigin - im->ysize;
+ grinfo_push(im, sprintf_alloc("graph_top"), RD_I_CNT, info);
+ info.u_cnt = im->xsize;
+ grinfo_push(im, sprintf_alloc("graph_width"), RD_I_CNT, info);
+ info.u_cnt = im->ysize;
+ grinfo_push(im, sprintf_alloc("graph_height"), RD_I_CNT, info);
+ info.u_cnt = im->ximg;
+ grinfo_push(im, sprintf_alloc("image_width"), RD_I_CNT, info);
+ info.u_cnt = im->yimg;
+ grinfo_push(im, sprintf_alloc("image_height"), RD_I_CNT, info);
+
/* get actual drawing data and find min and max values */
if (data_proc(im) == -1)
return -1;
*ymin = walker->value.u_val;
} else if (strcmp(walker->key, "value_max") == 0) {
*ymax = walker->value.u_val;
- } else if (strncmp(walker->key, "print", 6) == 0) { /* keys are prdate[0..] */
+ } else if (strncmp(walker->key, "print", 6) == 0) { /* keys are prdate[0..] */
prlines++;
if (((*prdata) =
rrd_realloc((*prdata),
(*prdata)[prlines] = NULL;
strcpy((*prdata)[prlines - 1], walker->value.u_str);
} else if (strcmp(walker->key, "image") == 0) {
- fwrite(walker->value.u_blo.ptr, walker->value.u_blo.size, 1, (stream ? stream : stdout));
+ fwrite(walker->value.u_blo.ptr, walker->value.u_blo.size, 1,
+ (stream ? stream : stdout));
}
/* skip anything else */
walker = walker->next;
** - options parsing now in rrd_graph_options()
** - script parsing now in rrd_graph_script()
*/
-info_t * rrd_graph_v(
+info_t *rrd_graph_v(
int argc,
char **argv)
{
image_desc_t im;
- info_t *grinfo;
+ info_t *grinfo;
+
rrd_graph_init(&im);
/* a dummy surface so that we can measure text sizes for placements */
im.surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 10, 10);
}
if (im.rendered_image) {
infoval img;
+
img.u_blo.size = im.rendered_image_size;
img.u_blo.ptr = im.rendered_image;
grinfo_push(&im, sprintf_alloc("image"), RD_I_BLO, img);