1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
<?php
class GRAPHAxis {
var $aid;
var $title;
var $mode;
var $units;
var $range;
const MODE_STANDARD = 0;
const MODE_LOGARITHMIC = 1;
function __construct(array &$props = NULL, $aid = false) {
if ($aid) {
$this->aid = $aid;
$aprop = $aid . "_axis";
} else {
$this->aid = isset($props["axis"])?$props["axis"]:false;
$aprop = "axis";
}
$this->title = $props[$aprop . "_name"]?$props[$aprop . "_name"]:translate("default");
$this->units = $props[$aprop . "_units"];
if ($props[$aprop . '_mode']) {
$mode = $props[$aprop . '_mode'];
if (is_numeric($mode)){
$this->mode = $mode;
} else {
$name = "DRAWAxis::MODE_" . strtoupper($mode);
if (defined($name)) $this->mode = constant($name);
else throw new ADEIException(translate("Unknown axis mode (%s) is specified", $mode));
}
} else {
$this->mode = GRAPHAxis::MODE_STANDARD;
}
if (($props[$aprop . "_range"])&&(preg_match("/(.+)-(.+)/", $props[$aprop . "_range"], $m))) {
$this->range = array($m[1], $m[2]);
} else {
$this->range = false;
}
}
}
/*
class UIAxis extends GRAPHAxis {
}
*/
?>
|