1 | <?php |
---|
2 | |
---|
3 | /** |
---|
4 | * Orange Theme class |
---|
5 | */ |
---|
6 | class OrangeTheme extends Theme |
---|
7 | { |
---|
8 | private $font_color = '#CC4400'; |
---|
9 | private $background_color = '#FFEEDD'; |
---|
10 | private $axis_color = '#CC6600'; |
---|
11 | private $grid_color = '#CC6633'; |
---|
12 | |
---|
13 | function GetColorList() { |
---|
14 | return array( |
---|
15 | '#FF9900', |
---|
16 | '#FFCC00', |
---|
17 | '#AA6600', |
---|
18 | '#CCCC00', |
---|
19 | '#CC6600', |
---|
20 | '#FFFF66', |
---|
21 | '#CCFF00', |
---|
22 | '#CC3300', |
---|
23 | '#669933', |
---|
24 | '#EE7700', |
---|
25 | '#AAEE33', |
---|
26 | '#77AA00', |
---|
27 | '#CCFF99', |
---|
28 | '#FF6633', |
---|
29 | '#885500', |
---|
30 | '#AADD00', |
---|
31 | '#99CC44', |
---|
32 | '#887711', |
---|
33 | ); |
---|
34 | } |
---|
35 | |
---|
36 | function SetupGraph($graph) { |
---|
37 | |
---|
38 | // graph |
---|
39 | /* |
---|
40 | $img = $graph->img; |
---|
41 | $height = $img->height; |
---|
42 | $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); |
---|
43 | */ |
---|
44 | $graph->SetFrame(false); |
---|
45 | $graph->SetMarginColor('white'); |
---|
46 | $graph->SetBackgroundGradient($this->background_color, '#FFFFFF', GRAD_HOR, BGRAD_PLOT); |
---|
47 | |
---|
48 | // legend |
---|
49 | $graph->legend->SetFrameWeight(0); |
---|
50 | $graph->legend->Pos(0.5, 0.85, 'center', 'top'); |
---|
51 | $graph->legend->SetFillColor('white'); |
---|
52 | $graph->legend->SetLayout(LEGEND_HOR); |
---|
53 | $graph->legend->SetColumns(3); |
---|
54 | $graph->legend->SetShadow(false); |
---|
55 | $graph->legend->SetMarkAbsSize(5); |
---|
56 | |
---|
57 | // xaxis |
---|
58 | $graph->xaxis->title->SetColor($this->font_color); |
---|
59 | $graph->xaxis->SetColor($this->axis_color, $this->font_color); |
---|
60 | $graph->xaxis->SetTickSide(SIDE_BOTTOM); |
---|
61 | $graph->xaxis->SetLabelMargin(10); |
---|
62 | |
---|
63 | // yaxis |
---|
64 | $graph->yaxis->title->SetColor($this->font_color); |
---|
65 | $graph->yaxis->SetColor($this->axis_color, $this->font_color); |
---|
66 | $graph->yaxis->SetTickSide(SIDE_LEFT); |
---|
67 | $graph->yaxis->SetLabelMargin(8); |
---|
68 | $graph->yaxis->HideLine(); |
---|
69 | $graph->yaxis->HideTicks(); |
---|
70 | $graph->xaxis->SetTitleMargin(15); |
---|
71 | |
---|
72 | // grid |
---|
73 | $graph->ygrid->SetColor($this->grid_color); |
---|
74 | $graph->ygrid->SetLineStyle('dotted'); |
---|
75 | |
---|
76 | |
---|
77 | // font |
---|
78 | $graph->title->SetColor($this->font_color); |
---|
79 | $graph->subtitle->SetColor($this->font_color); |
---|
80 | $graph->subsubtitle->SetColor($this->font_color); |
---|
81 | |
---|
82 | // $graph->img->SetAntiAliasing(); |
---|
83 | } |
---|
84 | |
---|
85 | |
---|
86 | function SetupPieGraph($graph) { |
---|
87 | |
---|
88 | // graph |
---|
89 | $graph->SetFrame(false); |
---|
90 | |
---|
91 | // legend |
---|
92 | $graph->legend->SetFillColor('white'); |
---|
93 | /* |
---|
94 | $graph->legend->SetFrameWeight(0); |
---|
95 | $graph->legend->Pos(0.5, 0.85, 'center', 'top'); |
---|
96 | $graph->legend->SetLayout(LEGEND_HOR); |
---|
97 | $graph->legend->SetColumns(3); |
---|
98 | */ |
---|
99 | $graph->legend->SetShadow(false); |
---|
100 | $graph->legend->SetMarkAbsSize(5); |
---|
101 | |
---|
102 | // title |
---|
103 | $graph->title->SetColor($this->font_color); |
---|
104 | $graph->subtitle->SetColor($this->font_color); |
---|
105 | $graph->subsubtitle->SetColor($this->font_color); |
---|
106 | |
---|
107 | $graph->SetAntiAliasing(); |
---|
108 | } |
---|
109 | |
---|
110 | |
---|
111 | function PreStrokeApply($graph) { |
---|
112 | if ($graph->legend->HasItems()) { |
---|
113 | $img = $graph->img; |
---|
114 | $height = $img->height; |
---|
115 | $graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25); |
---|
116 | } |
---|
117 | } |
---|
118 | |
---|
119 | function ApplyPlot($plot) { |
---|
120 | |
---|
121 | switch (get_class($plot)) |
---|
122 | { |
---|
123 | case 'GroupBarPlot': |
---|
124 | { |
---|
125 | foreach ($plot->plots as $_plot) { |
---|
126 | $this->ApplyPlot($_plot); |
---|
127 | } |
---|
128 | break; |
---|
129 | } |
---|
130 | |
---|
131 | case 'AccBarPlot': |
---|
132 | { |
---|
133 | foreach ($plot->plots as $_plot) { |
---|
134 | $this->ApplyPlot($_plot); |
---|
135 | } |
---|
136 | break; |
---|
137 | } |
---|
138 | |
---|
139 | case 'BarPlot': |
---|
140 | { |
---|
141 | $plot->Clear(); |
---|
142 | |
---|
143 | $color = $this->GetNextColor(); |
---|
144 | $plot->SetColor($color); |
---|
145 | $plot->SetFillColor($color); |
---|
146 | $plot->SetShadow('red', 3, 4, false); |
---|
147 | break; |
---|
148 | } |
---|
149 | |
---|
150 | case 'LinePlot': |
---|
151 | { |
---|
152 | $plot->Clear(); |
---|
153 | |
---|
154 | $plot->SetColor($this->GetNextColor().'@0.4'); |
---|
155 | $plot->SetWeight(2); |
---|
156 | break; |
---|
157 | } |
---|
158 | |
---|
159 | case 'PiePlot': |
---|
160 | { |
---|
161 | $plot->ShowBorder(false); |
---|
162 | $plot->SetSliceColors($this->GetThemeColors()); |
---|
163 | break; |
---|
164 | } |
---|
165 | |
---|
166 | case 'PiePlot3D': |
---|
167 | { |
---|
168 | $plot->SetSliceColors($this->GetThemeColors()); |
---|
169 | break; |
---|
170 | } |
---|
171 | |
---|
172 | default: |
---|
173 | { |
---|
174 | } |
---|
175 | } |
---|
176 | } |
---|
177 | } |
---|
178 | |
---|
179 | |
---|
180 | ?> |
---|