summaryrefslogtreecommitdiffabout
path: root/src/grid.c
authorSergey Poznyakoff <gray@gnu.org.ua>2009-05-30 09:57:16 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2009-05-30 09:57:16 (GMT)
commit2a6ef4f51500091e535b2b47d709eee5cd52468c (patch) (side-by-side diff)
treee3e28622c41b8b477acf1f2be6db9955b7ab4c6b /src/grid.c
parentfbc8bdac6efb0c63a73c5105bbf4ecb304187e44 (diff)
downloadtagr-2a6ef4f51500091e535b2b47d709eee5cd52468c.tar.gz
tagr-2a6ef4f51500091e535b2b47d709eee5cd52468c.tar.bz2
Adjust vertical axis as needed.HEADmaster
* src/graph.c (default_monitor): New global. (find_max): New function. (draw_graph): Adjust max rate if requested. * src/grid.c (ygrid_create): Use mon->ystep_absolute to determine the type of grid. * src/readconfig.c (cb_monitor): Handle `monitor default'. (monitor_kw): New statements: max-adjust and y-step-absolute. (tagr_kw): Remove rate-units kw. * src/tagr.h (struct monitor): New members: max_adjust and ystep_absolute. (default_monitor): New extern.
Diffstat (limited to 'src/grid.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/grid.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/grid.c b/src/grid.c
index 08e1c08..4ecb576 100644
--- a/src/grid.c
+++ b/src/grid.c
@@ -95,7 +95,10 @@ ygrid_create (grid_t grid, void *cdata)
{
struct monitor *mon = cdata;
struct ygrid_data *gr = xmalloc (sizeof (*gr));
- gr->step = mon->ystep;
+ if (mon->ystep_absolute)
+ gr->step = mon->ystep;
+ else
+ gr->step = mon->ystep * mon->max_rate;
return gr;
}

Return to:

Send suggestions and report system problems to the System administrator.