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) {