Changeset 1ff8feba541fcb92dc93174b0a3493fa113dab2b
- Timestamp:
- 06/19/09 20:07:13
(4 years ago)
- Author:
- Umar Farooq <umar@omniti.com>
- git-committer:
- Umar Farooq <umar@omniti.com> 1245442033 +0000
- git-parent:
[1c94710a8ffc6521b5140ecdda68892fb4f9efad]
- git-author:
- Umar Farooq <umar@omniti.com> 1245442033 +0000
- Message:
check if we have datasets in the graph before doing stuff like calculating percentiles, caused issues when we remove all datasets from a graph
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r1fa32a0 |
r1ff8feb |
|
| 332 | 332 | } |
|---|
| 333 | 333 | function percentile($arr, $p, $groupname = 'left', $attr = NULL) { |
|---|
| | 334 | |
|---|
| 334 | 335 | // This sums the sets and returns the XX percentile bucket. |
|---|
| 335 | | if(!is_array($arr)) return array(); |
|---|
| | 336 | if(!is_array($arr) || !count($arr)) return array(); |
|---|
| 336 | 337 | if(!is_array($p)) $p = array($p); |
|---|
| 337 | 338 | $full = array(); |
|---|
| r4555bbf |
r1ff8feb |
|
| 82 | 82 | }//end if stacking |
|---|
| 83 | 83 | */ |
|---|
| | 84 | |
|---|
| | 85 | if(count($a)) { |
|---|
| 84 | 86 | $start_ts = $a[0]['data'][0][0]; |
|---|
| 85 | 87 | $finish = end($a[0]['data']); |
|---|
| … | … | |
| 94 | 96 | ); |
|---|
| 95 | 97 | } |
|---|
| | 98 | } |
|---|
| 96 | 99 | return $a; |
|---|
| 97 | 100 | } |
|---|