summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 92912cb)
raw | patch | inline | side by side (parent: 92912cb)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 29 Jun 2008 13:57:00 +0000 (13:57 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 29 Jun 2008 13:57:00 +0000 (13:57 +0000) |
doc/rrdgraph.pod | patch | blob | history | |
src/rrd_graph.c | patch | blob | history |
diff --git a/doc/rrdgraph.pod b/doc/rrdgraph.pod
index 048171a3f09bd9185858e775a120c06819778a26..092e37fc59fc1d9471d27deddfb78f1e3c664800 100644 (file)
--- a/doc/rrdgraph.pod
+++ b/doc/rrdgraph.pod
[B<-z>|B<--lazy>]
-Only generate the graph if the current graph is out of date or not
-existent.
+Only generate the graph if the current graph is out of date or not existent.
+Note, that only the image size will be returned, if you run with lazy even
+when using graphv.
+
[B<-f>|B<--imginfo> I<printfstr>]
diff --git a/src/rrd_graph.c b/src/rrd_graph.c
index 300fdbe784bec805c635c0172631c5869dd217ec..e671f78617663dbf8f4f12dfa4d5137837b18551 100644 (file)
--- a/src/rrd_graph.c
+++ b/src/rrd_graph.c
PangoFontMap *font_map = pango_cairo_font_map_get_default();
/* if we are lazy and there is nothing to PRINT ... quit now */
- if (lazy && im->prt_c == 0)
+ if (lazy && im->prt_c == 0) {
+ 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;
+ }
/* pull the data from the rrd files ... */
if (data_fetch(im) == -1)
return -1;
return -1;
/* calculate and PRINT and GPRINT definitions. We have to do it at
* this point because it will affect the length of the legends
- * if there are no graph elements we stop here ...
+ * if there are no graph elements (i==0) we stop here ...
* if we are lazy, try to quit ...
*/
- i = print_calc(im);
+ i = print_calc(im);
if (i < 0)
return -1;
+
if ((i == 0) || lazy)
return 0;
+
/**************************************************************
*** Calculating sizes and locations became a bit confusing ***
*** so I moved this into a separate function. ***
walker = walker->next;
}
walker = grinfo;
- while (walker) {
+ *xsize = 0;
+ *ysize = 0;
+ *ymin = 0;
+ *ymax = 0;
+ while (walker) {
if (strcmp(walker->key, "image_width") == 0) {
*xsize = walker->value.u_int;
} else if (strcmp(walker->key, "image_height") == 0) {
src = &im->gdes[dst->vidx];
data = src->data + src->ds;
end =
- src->end_orig % src->step ==
- 0 ? src->end_orig : (src->end_orig + src->step -
- src->end_orig % src->step);
+ src->end_orig % (long)src->step ==
+ 0 ? src->end_orig : (src->end_orig + (long)src->step -
+ src->end_orig % (long)src->step);
steps = (end - src->start) / src->step;
#if 0