summaryrefslogtreecommitdiffstats
path: root/src/options/renderer_3d.php
blob: 92c0194b4788f50a4c5003dae92bb0f766dcc091 (plain)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<?php
/**
 * File containing the ezcGraphRenderer3dOptions class
 *
 * @package Graph
 * @version //autogentag//
 * @copyright Copyright (C) 2005, 2006 eZ systems as. All rights reserved.
 * @license http://ez.no/licenses/new_bsd New BSD License
 */
/**
 * Class containing the basic options for pie charts
 *
 * @package Graph
 */
class ezcGraphRenderer3dOptions extends ezcGraphChartOptions
{
    /**
     * Percent of chart height used as maximum height for pie chart labels
     * 
     * @var float
     * @access protected
     */
    protected $maxLabelHeight = .15;

    /**
     * Indicates wheather to show the line between pie elements and labels
     * 
     * @var bool
     */
    protected $showSymbol = true;

    /**
     * Size of symbols used concat a label with a pie
     * 
     * @var float
     * @access protected
     */
    protected $symbolSize = 6;

    /**
     * Percent to move pie chart elements out of the middle on highlight
     * 
     * @var float
     * @access protected
     */
    protected $moveOut = .1;

    /**
     * Position of title in a box
     * 
     * @var int
     */
    protected $titlePosition = ezcGraph::TOP;

    /**
     * Alignement of box titles 
     * 
     * @var int
     */
    protected $titleAlignement = 48; // ezcGraph::MIDDLE | ezcGraph::CENTER

    /**
     * Part of picture used to simulate depth of three dimensional chart
     * 
     * @var float
     */
    protected $depth = .1;

    /**
     * Indicates wheather the full depth should be used for each line in the
     * chart, or beeing seperated by the count of lines
     * 
     * @var bool
     */
    protected $seperateLines = true;

    /**
     * Transparency used to fill the axis polygon
     * 
     * @var float
     */
    protected $fillAxis = .8;

    /**
     * Transparency used to fill the grid lines
     * 
     * @var float
     */
    protected $fillGrid = 0;

    /**
     * Factor to darken border of data elements, like lines, bars and pie 
     * segments
     * 
     * @var float
     */
    protected $dataBorder = .5;

    /**
     * Height of the pie charts border
     * 
     * @var float
     */
    protected $pieChartHeight = 10;

    /**
     * Rotation of pie chart. Defines the percent of width used to calculate
     * the height of the ellipse.
     * 
     * @var float
     */
    protected $pieChartRotation = .6;

    /**
     * Used transparency for pie chart shadows
     * 
     * @var float
     */
    protected $pieChartShadow = .6;

    /**
     * Procentual distance between bar blocks
     * 
     * @var float
     */
    protected $barMargin = .1;

    /**
     * Procentual distance between bars
     * 
     * @var float
     */
    protected $barPadding = .05;

    /**
     * Factor to darken the color used for the bars side polygon
     * 
     * @var float
     */
    protected $barDarkenSide = .2;

    /**
     * Factor to darken the color used for the bars top polygon
     * 
     * @var float
     */
    protected $barDarkenTop = .4;

    /**
     * Set an option value
     * 
     * @param string $propertyName 
     * @param mixed $propertyValue 
     * @throws ezcBasePropertyNotFoundException
     *          If a property is not defined in this class
     * @return void
     */
    public function __set( $propertyName, $propertyValue )
    {
        switch ( $propertyName )
        {
            case 'maxLabelHeight':
                $this->maxLabelHeight = min( 1, max( 0, (float) $propertyValue ) );
                break;
            case 'symbolSize':
                $this->symbolSize = (int) $propertyValue;
                break;
            case 'moveOut':
                $this->moveOut = min( 1, max( 0, (float) $propertyValue ) );
                break;
            case 'showSymbol':
                $this->showSymbol = (bool) $propertyValue;
                break;
            case 'titlePosition':
                $this->titlePosition = (int) $propertyValue;
                break;
            case 'titleAlignement':
                $this->titleAlignement = (int) $propertyValue;
                break;
            case 'depth':
                $this->depth = min( 1, max( 0, (float) $propertyValue ) );
                break;
            case 'seperateLines':
                $this->seperateLines = (bool) $propertyValue;
                break;
            case 'fillAxis':
                $this->fillAxis = min( 1, max( 0, (float) $propertyValue ) );
                break;
            case 'fillGrid':
                $this->fillGrid = min( 1, max( 0, (float) $propertyValue ) );
                break;
            case 'dataBorder':
                $this->dataBorder = min( 1, max( 0, (float) $propertyValue ) );
                break;
            case 'pieChartHeight':
                $this->pieChartHeight = (float) $propertyValue;
                break;
            case 'pieChartRotation':
                $this->pieChartRotation = min( 1, max( 0, (float) $propertyValue ) );
                break;
            case 'pieChartRotation':
                $this->pieChartRotation = min( 1, max( 0, (float) $propertyValue ) );
                break;
            case 'pieChartShadow':
                $this->pieChartShadow = min( 1, max( 0, (float) $propertyValue ) );
                break;
            case 'barMargin':
                $this->barMargin = min( 1, max( 0, (float) $propertyValue ) );
                break;
            case 'barPadding':
                $this->barPadding = min( 1, max( 0, (float) $propertyValue ) );
                break;
            case 'barDarkenSide':
                $this->barDarkenSide = min( 1, max( 0, (float) $propertyValue ) );
                break;
            case 'barDarkenTop':
                $this->barDarkenTop = min( 1, max( 0, (float) $propertyValue ) );
                break;
            default:
                return parent::__set( $propertyName, $propertyValue );
        }
    }
}

?>
OpenPOWER on IntegriCloud