|
|
| Author |
Message |
Alain Tesio Guest
|
Posted: Thu Oct 17, 2002 11:38 pm Post subject: Autoscale with a fixed minimum. Or |
|
|
| Hi, I'd like to use the autoscale option for graphics but still keep the minimum at 0 (so an area twice bigger really means a value twice bigger) |
|
| Back to top |
|
 |
raX Lead Developer
Joined: 13 Oct 2001 Posts: 2235 Location: Carlisle, PA
|
Posted: Fri Oct 18, 2002 9:41 am Post subject: |
|
|
Yeah, I think that would be really cool too. I can think of a few situtions where it would make graphs looks nicer. Do you know if rrdtool can do this though? If it can, it should not be a problem for cacti to support it.
-Ian |
|
| Back to top |
|
 |
Alain Tesio
Joined: 19 Oct 2002 Posts: 7 Location: Paris, France
|
Posted: Sat Oct 19, 2002 6:02 pm Post subject: |
|
|
Hi, it's supported by rrdtool, the option --alt-autoscale-max only autoscales the maximum value, so you should set the configured lower limit, see the patch below.
Another problem in rrdtool is that the man page says that the default lower limit is 0, but using alt-autoscale-max with no explicit lower limit autoscales the lower limit anyway.
| Code: |
*** include/rrd_functions.php.orig Sat Oct 19 16:57:19 2002
--- include/rrd_functions.php Sat Oct 19 17:02:23 2002
***************
*** 362,367 ****
--- 362,368 ----
break;
case "2":
$scale .= "--alt-autoscale-max" . " \\\n";
+ $scale = "--lower-limit=" . mysql_result($sql_id, 0, "upperlimit") . " \\\n";
break;
}
|
|
|
| Back to top |
|
 |
Alain Tesio
Joined: 19 Oct 2002 Posts: 7 Location: Paris, France
|
Posted: Sat Oct 19, 2002 6:34 pm Post subject: |
|
|
| Sorry it's the wrong column in the mysql query |
|
| Back to top |
|
 |
bulek Cacti Pro User
Joined: 20 May 2002 Posts: 852 Location: Poland
|
Posted: Sun Oct 20, 2002 6:03 am Post subject: |
|
|
I don't understand the disscusion I guess. Why don't you just use "--alt-autoscale-max" option in cacti Graph Configuration along with "Lower Limit" field? Seems to be simpler than patching the code.
- bulek |
|
| Back to top |
|
 |
Alain Tesio
Joined: 19 Oct 2002 Posts: 7 Location: Paris, France
|
Posted: Sun Oct 20, 2002 5:13 pm Post subject: |
|
|
| That's the problem, if I do what you write cacti doens't run rrdgraph with the lower-limit option, my patch fixes this. |
|
| Back to top |
|
 |
bulek Cacti Pro User
Joined: 20 May 2002 Posts: 852 Location: Poland
|
Posted: Sun Oct 20, 2002 5:28 pm Post subject: |
|
|
You are right, I've never noticed this. Good point!
Shouldn't your added line be the following (two changes in red)?
$scale .= "--lower-limit=" . mysql_result($sql_id, 0, "lowerlimit") . " \\\n";
- bulek |
|
| Back to top |
|
 |
Alain Tesio
Joined: 19 Oct 2002 Posts: 7 Location: Paris, France
|
Posted: Mon Oct 21, 2002 2:48 pm Post subject: |
|
|
| yes sure ! |
|
| Back to top |
|
 |
Guest
|
Posted: Fri Oct 25, 2002 3:45 am Post subject: |
|
|
THX a lot for this patch
Now the option "--alt-autoscale-max" works fine. |
|
| Back to top |
|
 |
|