Better positioning of the pie when it is alone on the canvas
authoralex <alex@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Sat, 23 Mar 2002 20:41:48 +0000 (20:41 +0000)
committeralex <alex@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Sat, 23 Mar 2002 20:41:48 +0000 (20:41 +0000)
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@105 a5681a0c-68f1-0310-ab6d-d61299d08faa

src/rrd_graph.c

index 7908ad4..8b9e679 100644 (file)
@@ -2054,8 +2054,13 @@ graph_size_location(image_desc_t *im, int elements, int piechart )
     ** just below the title (if any) and with sufficient
     ** padding.
     */
-    im->pie_x = im->xgif - Xspacing - Xpie/2;
-    im->pie_y = im->yorigin-Ymain+Ypie/2;
+    if (elements) {
+       im->pie_x = im->xgif - Xspacing - Xpie/2;
+        im->pie_y = im->yorigin-Ymain+Ypie/2;
+    } else {
+       im->pie_x = im->xgif/2;
+        im->pie_y = im->yorigin-Ypie/2;
+    }
 
     return 0;
 }