Changeset 42acb3f97cfb6da615fe7d1186a1e052eeec72fd
- Timestamp:
- 06/24/08 14:20:34
(10 years ago)
- Author:
- Theo Schlossnagle <jesus@omniti.com>
- git-committer:
- Theo Schlossnagle <jesus@omniti.com> 1214317234 +0000
- git-parent:
[cdec30d496e979d90c58ae58a967db6da2a2b503]
- git-author:
- Theo Schlossnagle <jesus@omniti.com> 1214317234 +0000
- Message:
fix autounits
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
re7e6b89 |
r42acb3f |
|
18 | 18 | |
---|
19 | 19 | $i = 0; |
---|
| 20 | $autounits = 0; |
---|
20 | 21 | foreach(split(";", $_GET['metric']) as $m) { |
---|
21 | 22 | preg_match('/^(d|n|t)(l|r)(~|-)([0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12})-(.*)$/', $m, |
---|
22 | 23 | $matches); |
---|
23 | 24 | $settings = $graph_settings[$i++]; |
---|
24 | | if($matches[3] == '~') $settings['expression'] = '$this->bw($value)'; |
---|
| 25 | if($matches[3] == '~') { |
---|
| 26 | $autounits = 1; |
---|
| 27 | $settings['expression'] = '$this->autounits($value)'; |
---|
| 28 | } |
---|
25 | 29 | $settings['axis'] = ($matches[2] == 'l') ? 'left' : 'right'; |
---|
26 | 30 | if($matches[1] == 'n') |
---|
… | … | |
47 | 51 | <min><?php print ($driver->min() > 0) ? '0' : '' ?></min> |
---|
48 | 52 | <max><?php print ($driver->max() < 0) ? '0' : '' ?></max> |
---|
| 53 | <unit><?php print $autounits ? $driver->autounit() : "" ?></unit> |
---|
49 | 54 | </y_left> |
---|
50 | 55 | </values> |
---|