summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f279e27)
raw | patch | inline | side by side (parent: f279e27)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Thu, 7 Apr 2005 21:31:37 +0000 (21:31 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Thu, 7 Apr 2005 21:31:37 +0000 (21:31 +0000) |
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@371 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_graph.c | patch | blob | history |
diff --git a/src/rrd_graph.c b/src/rrd_graph.c
index 8391349cb8a16839b47c3a1d6177790fac8560bc..d63dbc5dce0bc3a27576d4d156d7185f1313da23 100644 (file)
--- a/src/rrd_graph.c
+++ b/src/rrd_graph.c
Xtitle =0, Ytitle =0,
Xylabel =0, Yylabel =0,
Xmain =0, Ymain =0,
+#ifdef WITH_PIECHART
Xpie =0, Ypie =0,
+#endif
Xxlabel =0, Yxlabel =0,
#if 0
Xlegend =0, Ylegend =0,
Xspacing =10, Yspacing =10;
if (im->extra_flags & ONLY_GRAPH) {
- Xspacing =0;
- Yspacing =0;
- } else {
- if (im->ylegend[0] != '\0') {
+ im->xorigin =0;
+ im->ximg = im->xsize;
+ im->yimg = im->ysize;
+ im->yorigin = im->ysize;
+ return 0;
+ }
+
+ if (im->ylegend[0] != '\0' ) {
Xvertical = im->text_prop[TEXT_PROP_UNIT].size *2;
Yvertical = gfx_get_text_width(im->canvas, 0,
im->text_prop[TEXT_PROP_UNIT].font,
im->text_prop[TEXT_PROP_UNIT].size,
im->tabwidth,im->ylegend, 0);
- }
}
+
if (im->title[0] != '\0') {
/* The title is placed "inbetween" two text lines so it
** automatically has some vertical spacing. The horizontal
** forget about it at all; the legend will have to fit in the
** size already allocated.
*/
- im->ximg = Xmain;
+ im->ximg = Xylabel + Xmain + 2 * Xspacing;
- if ( !(im->extra_flags & ONLY_GRAPH) ) {
- im->ximg = Xylabel + Xmain + Xpie + 2 * Xspacing;
- }
+#ifdef WITH_PIECHART
+ im->ximg += Xpie;
+#endif
if (Xmain) im->ximg += Xspacing;
+#ifdef WITH_PIECHART
if (Xpie) im->ximg += Xspacing;
+#endif
- if (im->extra_flags & ONLY_GRAPH) {
- im->xorigin = 0;
- } else {
- im->xorigin = Xspacing + Xylabel;
- }
+ im->xorigin = Xspacing + Xylabel;
if (Xtitle > im->ximg) im->ximg = Xtitle;
- if (Xvertical) {
+
+ if (Xvertical) { /* unit description */
im->ximg += Xvertical;
im->xorigin += Xvertical;
}
/* reserve space for main and/or pie */
- if (im->extra_flags & ONLY_GRAPH) {
- im->yimg = Ymain;
- } else {
- im->yimg = Ymain + Yxlabel;
- }
+ im->yimg = Ymain + Yxlabel;
+#ifdef WITH_PIECHART
if (im->yimg < Ypie) im->yimg = Ypie;
+#endif
- if (im->extra_flags & ONLY_GRAPH) {
- im->yorigin = im->yimg;
- } else {
- im->yorigin = im->yimg - Yxlabel;
- }
+ im->yorigin = im->yimg - Yxlabel;
/* reserve space for the title *or* some padding above the graph */
if (Ytitle) {