author | Dan |
Sun, 04 Jan 2009 16:40:36 -0500 | |
changeset 43 | ce2e9caf2dfa |
permissions | -rw-r--r-- |
43
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
1 |
<?php |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
2 |
require_once dirname(__FILE__) . "/class.graph.php"; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
3 |
|
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
4 |
class PieGraph extends CGraph { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
5 |
var $pie_color = array(array(39, 78, 120)); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
6 |
var $pie_deepnesscolor = array(array(9, 48, 90)); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
7 |
var $pie_bgcolor = array(array(69, 129, 194)); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
8 |
var $pie_deepness = 10; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
9 |
var $pie_total = 0; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
10 |
var $pie_startoffset = 0; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
11 |
|
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
12 |
function Graph() { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
13 |
$this->graph_width = $this->graph_padding['left'] + $this->graph_areawidth + $this->graph_padding['right']; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
14 |
$this->graph_height = $this->graph_padding['top'] + $this->graph_areaheight + $this->graph_padding['bottom']; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
15 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
16 |
|
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
17 |
function SetPieColor($red, $green, $blue) { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
18 |
$this->pie_color = array($red, $green, $blue); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
19 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
20 |
function AddPieColor($red, $green, $blue) { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
21 |
if (!is_array($this->pie_color[0])) { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
22 |
$this->pie_color = array($this->pie_color); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
23 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
24 |
$this->pie_color[] = array($red, $green, $blue); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
25 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
26 |
function SetPieBackgroundColor($red, $green, $blue) { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
27 |
$this->pie_bgcolor = array($red, $green, $blue); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
28 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
29 |
function AddPieBackgroundColor($red, $green, $blue) { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
30 |
if (!is_array($this->pie_bgcolor[0])) { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
31 |
$this->pie_bgcolor = array($this->pie_bgcolor); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
32 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
33 |
$this->pie_bgcolor[] = array($red, $green, $blue); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
34 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
35 |
function SetPieDeepnessColor($red, $green, $blue) { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
36 |
$this->pie_deepnesscolor = array($red, $green, $blue); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
37 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
38 |
function AddPieDeepnessColor($red, $green, $blue) { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
39 |
if (!is_array($this->pie_deepnesscolor[0])) { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
40 |
$this->pie_deepnesscolor = array($this->pie_deepnesscolor); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
41 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
42 |
$this->pie_deepnesscolor[] = array($red, $green, $blue); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
43 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
44 |
function SetPieTotalValue($total) { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
45 |
$this->pie_total = $total; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
46 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
47 |
function SetPieStartOffset($offset) { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
48 |
if ($offset < 0 || $offset > 359) $offset = 0; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
49 |
$this->pie_startoffset = $offset; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
50 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
51 |
function SetPieData($data) { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
52 |
CGraph::SetData($data); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
53 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
54 |
function DrawGraph($file = "") { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
55 |
$this->im = imagecreatetruecolor($this->graph_width, $this->graph_height); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
56 |
|
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
57 |
$this->axis_positions = array(0, 0, 0, 0); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
58 |
$this->axis_xscalevisible = 0; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
59 |
$this->axis_yscalevisible = 0; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
60 |
$this->axis_gridlines = 0; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
61 |
|
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
62 |
CGraph::DrawGraph(); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
63 |
|
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
64 |
if ($this->pie_total == 0) { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
65 |
foreach ($this->data as $name => $value) { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
66 |
$this->pie_total += $value; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
67 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
68 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
69 |
// deepness |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
70 |
for ($i = $this->pie_deepness; $i > 0; $i--) { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
71 |
$offset = 0; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
72 |
$p = 0; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
73 |
foreach ($this->data as $n => $value) { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
74 |
if (!$this->pie_deepnesscolor[$p]) { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
75 |
$this->__AllocateColor("im_pie_deepnesscolor", $this->pie_deepnesscolor[$p], 0, $p); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
76 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
77 |
$from = round($this->pie_startoffset - ($offset * 360 / $this->pie_total)); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
78 |
$to = round($this->pie_startoffset - (($value + $offset) * 360 / $this->pie_total)); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
79 |
if ($from < 0) $from += 360; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
80 |
if ($to < 0) $to += 360; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
81 |
imagefilledarc($this->im, round($this->graph_width / 2), round($this->graph_height / 2) + $i, |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
82 |
$this->graph_areawidth, $this->graph_areaheight, |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
83 |
$to, $from, $this->pie_deepnesscolor[$p], IMG_ARC_PIE); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
84 |
$offset += $value; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
85 |
$p++; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
86 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
87 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
88 |
$offset = 0; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
89 |
$p = 0; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
90 |
foreach ($this->data as $n => $value) { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
91 |
$this->__AllocateColor("im_pie_color", $this->pie_color[$p], 0, $p); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
92 |
|
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
93 |
$from = round($this->pie_startoffset - ($offset * 360 / $this->pie_total)); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
94 |
$to = round($this->pie_startoffset - (($value + $offset) * 360 / $this->pie_total)); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
95 |
if ($from < 0) $from += 360; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
96 |
if ($to < 0) $to += 360; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
97 |
imagefilledarc($this->im, round($this->graph_width / 2), round($this->graph_height / 2), |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
98 |
$this->graph_areawidth, $this->graph_areaheight, |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
99 |
$to, $from, $this->im_pie_color[$p], IMG_ARC_PIE); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
100 |
$offset += $value; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
101 |
$p++; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
102 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
103 |
|
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
104 |
CGraph::DrawGraph2(); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
105 |
|
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
106 |
if (strlen($file)) { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
107 |
$ret = imagepng($this->im, $file); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
108 |
} else { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
109 |
header("Content-Type: image/png"); // thanks to Marcin G. :) |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
110 |
imagepng($this->im); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
111 |
$ret = true; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
112 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
113 |
imagedestroy($this->im); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
114 |
return $ret; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
115 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
116 |
|
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
117 |
function __DrawPieSlice($frompercent, $topercent, $color, $deepcolor) { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
118 |
$from = round(270 - ($frompercent * 3.6)); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
119 |
$to = round(270 - ($topercent * 3.6)); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
120 |
if ($from < 0) $from += 360; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
121 |
if ($to < 0) $to += 360; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
122 |
//echo "FROM:" . $from . " TO:" . $to . "<br>\n"; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
123 |
for ($i = $this->pie_deepness; $i > 0; $i--) { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
124 |
imagefilledarc($this->im, round($this->graph_width / 2), round($this->graph_height / 2) + $i, |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
125 |
round($this->graph_areawidth / 2), round($this->graph_areaheight / 2), |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
126 |
$to, $from, $deepcolor, IMG_ARC_PIE); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
127 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
128 |
imagefilledarc($this->im, round($this->graph_width / 2), round($this->graph_height / 2), |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
129 |
round($this->graph_areawidth / 2), round($this->graph_areaheight / 2), |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
130 |
$to, $from, $color, IMG_ARC_PIE); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
131 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
132 |
|
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
133 |
/** |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
134 |
* Graph::__LoadPieValues() |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
135 |
* Loads definitions to pie settings |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
136 |
**/ |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
137 |
function __LoadPieValues($data) { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
138 |
foreach ($data as $name => $value) { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
139 |
$name = strtolower($name); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
140 |
switch ($name) { |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
141 |
case 'background-color': |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
142 |
$this->__SetColorToValue("pie_bgcolor", $value); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
143 |
break; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
144 |
case 'color': |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
145 |
$this->__SetColorToValue("pie_color", $value); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
146 |
break; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
147 |
case 'deepness-color': |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
148 |
$this->__SetColorToValue("pie_depnesscolor", $value); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
149 |
break; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
150 |
case 'offset': |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
151 |
$this->SetPieStartOffset($value); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
152 |
break; |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
153 |
case 'total': |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
154 |
$this->SetPieTotalValue($value); |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
155 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
156 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
157 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
158 |
} |
ce2e9caf2dfa
Added support for different types of graphs; added a last 60 minutes line graph
Dan
parents:
diff
changeset
|
159 |
?> |