aboutsummaryrefslogtreecommitdiff
path: root/src/graph.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/graph.c')
-rw-r--r--src/graph.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/graph.c b/src/graph.c
index 02e0586..80b2a97 100644
--- a/src/graph.c
+++ b/src/graph.c
@@ -89,7 +89,7 @@ draw_graph (FILE *fp,
89 int full_xsize = graph_xsize + graph_h_margin[0] + graph_h_margin[1]; 89 int full_xsize = graph_xsize + graph_h_margin[0] + graph_h_margin[1];
90 int full_ysize = graph_ysize + graph_v_margin[0] + graph_v_margin[1]; 90 int full_ysize = graph_ysize + graph_v_margin[0] + graph_v_margin[1];
91 grid_t grid; 91 grid_t grid;
92 unsigned long ymax = mon->max_rate; 92 double ymax = mon->max_rate;
93 93
94 yscale = (double) graph_ysize / ymax; 94 yscale = (double) graph_ysize / ymax;
95 xscale = (double) graph_xsize / xmax; 95 xscale = (double) graph_xsize / xmax;
@@ -210,16 +210,16 @@ draw_graph (FILE *fp,
210 grid = grid_create (ygrid, dataq, 0, ymax, mon); 210 grid = grid_create (ygrid, dataq, 0, ymax, mon);
211 if (grid) 211 if (grid)
212 { 212 {
213 unsigned long i; 213 double d;
214 char *str = NULL; 214 char *str = NULL;
215 215
216 draw_vtext (graph, i_grid, 216 draw_vtext (graph, i_grid,
217 mon->rate_unit ? mon->rate_unit : rate_unit); 217 mon->rate_unit ? mon->rate_unit : rate_unit);
218 218
219 /* Draw vertical grid */ 219 /* Draw vertical grid */
220 while ((i = grid_next (grid, &str, NULL)) < ymax) 220 while ((d = grid_next (grid, &str, NULL)) < ymax)
221 { 221 {
222 int y = ytr (i); 222 int y = ytr (d);
223 223
224 /* Left tick */ 224 /* Left tick */
225 gdImageLine (graph, 225 gdImageLine (graph,
@@ -247,13 +247,13 @@ draw_graph (FILE *fp,
247 grid = grid_create (xgrid, dataq, 0, xmax, &start); 247 grid = grid_create (xgrid, dataq, 0, xmax, &start);
248 if (grid) 248 if (grid)
249 { 249 {
250 unsigned long i; 250 double d;
251 char *str = NULL; 251 char *str = NULL;
252 int mark; 252 int mark;
253 253
254 while ((i = grid_next (grid, &str, &mark)) < xmax) 254 while ((d = grid_next (grid, &str, &mark)) < xmax)
255 { 255 {
256 int x = xtr (i); 256 int x = xtr (d);
257 257
258 /* Tick */ 258 /* Tick */
259 gdImageLine (graph, 259 gdImageLine (graph,

Return to:

Send suggestions and report system problems to the System administrator.