colors start with # not :
[rrdtool.git] / src / rrd_graph.c
index 77a5051..b5410f3 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * RRDtool 1.2.9  Copyright by Tobi Oetiker, 1997-2005
+ * RRDtool 1.2.10  Copyright by Tobi Oetiker, 1997-2005
  ****************************************************************************
  * rrd__graph.c  produce graphs from data in rrdfiles
  ****************************************************************************/
@@ -1547,7 +1547,7 @@ calc_horizontal_grid(image_desc_t   *im)
            if(decimals <= 0) /* everything is small. make place for zero */
                decimals = 1;
            
-           im->ygrid_scale.gridstep = pow((double)10, floor(log10(range)));
+           im->ygrid_scale.gridstep = pow((double)10, floor(log10(range*im->viewfactor/im->magfact)))/im->viewfactor*im->magfact;
            
            if(im->ygrid_scale.gridstep == 0) /* range is one -> 0.1 is reasonable scale */
                im->ygrid_scale.gridstep = 0.1;
@@ -1573,7 +1573,7 @@ calc_horizontal_grid(image_desc_t   *im)
            } else {
                int len = decimals + 1;
                if (im->unitslength < len+2) im->unitslength = len+2;
-               sprintf(im->ygrid_scale.labfmt, "%%%d.1f%s", len, ( im->symbol != ' ' ? " %c" : "" ));
+               sprintf(im->ygrid_scale.labfmt, "%%%d.0f%s", len, ( im->symbol != ' ' ? " %c" : "" ));
            }
        }
        else {
@@ -1844,11 +1844,11 @@ vertical_grid(
 # error "your libc has no strftime I guess we'll abort the exercise here."
 #endif
        gfx_new_text ( im->canvas,
-                     xtr(im,tilab), Y0+im->text_prop[TEXT_PROP_AXIS].size,
+                     xtr(im,tilab), Y0+im->text_prop[TEXT_PROP_AXIS].size*1.4+5,
                      im->graph_col[GRC_FONT],
                      im->text_prop[TEXT_PROP_AXIS].font,
                      im->text_prop[TEXT_PROP_AXIS].size,
-                     im->tabwidth, 0.0, GFX_H_CENTER, GFX_V_TOP,
+                     im->tabwidth, 0.0, GFX_H_CENTER, GFX_V_BOTTOM,
                      graph_label );
        
     }
@@ -3150,7 +3150,7 @@ rrd_graph_options(int argc, char *argv[],image_desc_t *im)
 
            if(sscanf(optarg,
                                "%10[A-Z]:%lf:%1000s",
-                               prop,&size,font) == 3){
+                               prop,&size,font) >= 2){
                int sindex,propidx;
                if((sindex=text_prop_conv(prop)) != -1){
                   for (propidx=sindex;propidx<TEXT_PROP_LAST;propidx++){