reintroduced the FRAME color ... somehow it was lost from 1.0.x
[rrdtool.git] / src / rrd_graph.c
index bb4c542..a258685 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "rrd_tool.h"
 
-#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
+#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
 #include <io.h>
 #include <fcntl.h>
 #endif
@@ -100,8 +100,9 @@ gfx_color_t graph_col[] =   /* default colors */
      0xE0505080,   /* major grid */
      0x000000FF,   /* font       */ 
      0x802020FF,   /* arrow      */
-     0x202020FF    /* axis       */
-};
+     0x202020FF,   /* axis       */
+     0x000000FF    /* frame      */ 
+};     
 
 
 /* #define DEBUG */
@@ -151,9 +152,9 @@ ytr(image_desc_t *im, double value){
     if (! im->rigid) {
       /* keep yval as-is */
     } else if (yval > im->yorigin) {
-      yval = im->yorigin;
+      yval = im->yorigin +0.00001;
     } else if (yval < im->yorigin - im->ysize){
-      yval = im->yorigin - im->ysize;
+      yval = im->yorigin - im->ysize - 0.00001;
     } 
     return yval;
 }
@@ -222,6 +223,7 @@ enum grc_en grc_conv(char *string){
     conv_if(FONT,GRC_FONT)
     conv_if(ARROW,GRC_ARROW)
     conv_if(AXIS,GRC_AXIS)
+    conv_if(FRAME,GRC_FRAME)
 
     return -1; 
 }
@@ -2021,7 +2023,7 @@ grid_paint(image_desc_t   *im)
                             node = gfx_new_line(im->canvas,
                                                 X0-1,Y0-boxV,
                                                 X0-1,Y0,
-                                                1,im->graph_col[GRC_FONT]);
+                                                1,im->graph_col[GRC_FRAME]);
                             gfx_add_point(node,X0+boxH,Y0);
                             gfx_add_point(node,X0+boxH,Y0-boxV);
                             gfx_close_path(node);
@@ -2387,11 +2389,11 @@ graph_paint(image_desc_t *im, char ***calcpr)
   
   node=gfx_new_area ( im->canvas,
                       0, 0,
-                      im->ximg, 0,
-                      im->ximg, im->yimg,
+                      0, im->yimg,
+                     im->ximg, im->yimg,                      
                       im->graph_col[GRC_BACK]);
 
-  gfx_add_point(node,0, im->yimg);
+  gfx_add_point(node,im->ximg, 0);
 
 #ifdef WITH_PIECHART
   if (piechart != 2) {
@@ -2634,7 +2636,7 @@ graph_paint(image_desc_t *im, char ***calcpr)
   
   if (strcmp(im->graphfile,"-")==0) {
     fo = im->graphhandle ? im->graphhandle : stdout;
-#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
+#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
     /* Change translation mode for stdout to BINARY */
     _setmode( _fileno( fo ), O_BINARY );
 #endif
@@ -2645,7 +2647,7 @@ graph_paint(image_desc_t *im, char ***calcpr)
       return (-1);
     }
   }
-  gfx_render (im->canvas,im->ximg,im->yimg,0x0,fo);
+  gfx_render (im->canvas,im->ximg,im->yimg,0x00000000,fo);
   if (strcmp(im->graphfile,"-") != 0)
     fclose(fo);
   return 0;
@@ -2839,7 +2841,7 @@ rrd_graph_init(image_desc_t *im)
     for(i=0;i<DIM(graph_col);i++)
         im->graph_col[i]=graph_col[i];
 
-#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
+#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
     {
             char *windir; 
            char rrd_win_default_font[1000];