summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ed0f3b3)
raw | patch | inline | side by side (parent: ed0f3b3)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Wed, 14 Feb 2007 06:53:01 +0000 (06:53 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Wed, 14 Feb 2007 06:53:01 +0000 (06:53 +0000) |
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@1003 a5681a0c-68f1-0310-ab6d-d61299d08faa
doc/rrdgraph.pod | patch | blob | history | |
src/rrd_graph.c | patch | blob | history | |
src/rrd_graph.h | patch | blob | history |
diff --git a/doc/rrdgraph.pod b/doc/rrdgraph.pod
index b7bf370608c37488ea60891d5f7e1a011744d17b..59d3ac4ad65910b62e2519ae6abecacc451d0c87 100644 (file)
--- a/doc/rrdgraph.pod
+++ b/doc/rrdgraph.pod
suppress the grid and labels altogether. The default for this option is
to automatically select sensible values.
+If you have set --y-grid to 'none' not only the labels get supressed, also
+the space reserved for the labels is removed. You can still add space
+manually if you use the --units-length command to explicitly reserve space.
+
[B<-Y>|B<--alt-y-grid>]
Place the Y grid dynamically based on the graph's Y range. The algorithm
diff --git a/src/rrd_graph.c b/src/rrd_graph.c
index 9be24e8aaba270e273b746c936deb88251ab016e..5a54c3dfe9d0dc13134e948dd4b78b891808944f 100644 (file)
--- a/src/rrd_graph.c
+++ b/src/rrd_graph.c
if (im->draw_x_grid) {
Yxlabel=im->text_prop[TEXT_PROP_AXIS].size *2.5;
}
- if (im->draw_y_grid) {
+ if (im->draw_y_grid || im->forceleftspace ) {
Xylabel=gfx_get_text_width(im->canvas, 0,
im->text_prop[TEXT_PROP_AXIS].font,
im->text_prop[TEXT_PROP_AXIS].size,
im->maxval = DNAN;
im->unitsexponent= 9999;
im->unitslength= 6;
+ im->forceleftspace = 0;
im->symbol = ' ';
im->viewfactor = 1.0;
im->extra_flags= 0;
break;
case 'L':
im->unitslength = atoi(optarg);
+ im->forceleftspace = 1;
break;
case 'T':
im->tabwidth = atof(optarg);
diff --git a/src/rrd_graph.h b/src/rrd_graph.h
index 6ed66d2f4327a9e89e1ede3b63fc87e46117b9f2..2e8e3bc341f85cdd6c4c20d048b235338912a4f7 100644 (file)
--- a/src/rrd_graph.h
+++ b/src/rrd_graph.h
#endif
long ximg,yimg; /* total size of the image */
double magfact; /* numerical magnitude*/
- long base; /* 1000 or 1024 depending on what we graph */
+ long base; /* 1000 or 1024 depending on what we graph */
char symbol; /* magnitude symbol for y-axis */
float viewfactor; /* how should the numbers on the y-axis be scaled for viewing ? */
- int unitsexponent; /* 10*exponent for units on y-asis */
+ int unitsexponent; /* 10*exponent for units on y-asis */
int unitslength; /* width of the yaxis labels */
+ int forceleftspace; /* do not kill the space to the left of the y-axis if there is no grid */
+
int extra_flags; /* flags for boolean options */
/* data elements */