3 namespace PhpOffice\PhpSpreadsheet\Chart
;
11 abstract class Properties
14 EXCEL_COLOR_TYPE_STANDARD
= 'prstClr';
15 const EXCEL_COLOR_TYPE_SCHEME
= 'schemeClr';
16 const EXCEL_COLOR_TYPE_ARGB
= 'srgbClr';
19 AXIS_LABELS_LOW
= 'low';
20 const AXIS_LABELS_HIGH
= 'high';
21 const AXIS_LABELS_NEXT_TO
= 'nextTo';
22 const AXIS_LABELS_NONE
= 'none';
25 TICK_MARK_NONE
= 'none';
26 const TICK_MARK_INSIDE
= 'in';
27 const TICK_MARK_OUTSIDE
= 'out';
28 const TICK_MARK_CROSS
= 'cross';
31 HORIZONTAL_CROSSES_AUTOZERO
= 'autoZero';
32 const HORIZONTAL_CROSSES_MAXIMUM
= 'max';
35 FORMAT_CODE_GENERAL
= 'General';
36 const FORMAT_CODE_NUMBER
= '#,##0.00';
37 const FORMAT_CODE_CURRENCY
= '$#,##0.00';
38 const FORMAT_CODE_ACCOUNTING
= '_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)';
39 const FORMAT_CODE_DATE
= 'm/d/yyyy';
40 const FORMAT_CODE_TIME
= '[$-F400]h:mm:ss AM/PM';
41 const FORMAT_CODE_PERCENTAGE
= '0.00%';
42 const FORMAT_CODE_FRACTION
= '# ?/?';
43 const FORMAT_CODE_SCIENTIFIC
= '0.00E+00';
44 const FORMAT_CODE_TEXT
= '@';
45 const FORMAT_CODE_SPECIAL
= '00000';
48 ORIENTATION_NORMAL
= 'minMax';
49 const ORIENTATION_REVERSED
= 'maxMin';
52 LINE_STYLE_COMPOUND_SIMPLE
= 'sng';
53 const LINE_STYLE_COMPOUND_DOUBLE
= 'dbl';
54 const LINE_STYLE_COMPOUND_THICKTHIN
= 'thickThin';
55 const LINE_STYLE_COMPOUND_THINTHICK
= 'thinThick';
56 const LINE_STYLE_COMPOUND_TRIPLE
= 'tri';
57 const LINE_STYLE_DASH_SOLID
= 'solid';
58 const LINE_STYLE_DASH_ROUND_DOT
= 'sysDot';
59 const LINE_STYLE_DASH_SQUERE_DOT
= 'sysDash';
60 const LINE_STYPE_DASH_DASH
= 'dash';
61 const LINE_STYLE_DASH_DASH_DOT
= 'dashDot';
62 const LINE_STYLE_DASH_LONG_DASH
= 'lgDash';
63 const LINE_STYLE_DASH_LONG_DASH_DOT
= 'lgDashDot';
64 const LINE_STYLE_DASH_LONG_DASH_DOT_DOT
= 'lgDashDotDot';
65 const LINE_STYLE_CAP_SQUARE
= 'sq';
66 const LINE_STYLE_CAP_ROUND
= 'rnd';
67 const LINE_STYLE_CAP_FLAT
= 'flat';
68 const LINE_STYLE_JOIN_ROUND
= 'bevel';
69 const LINE_STYLE_JOIN_MITER
= 'miter';
70 const LINE_STYLE_JOIN_BEVEL
= 'bevel';
71 const LINE_STYLE_ARROW_TYPE_NOARROW
= null;
72 const LINE_STYLE_ARROW_TYPE_ARROW
= 'triangle';
73 const LINE_STYLE_ARROW_TYPE_OPEN
= 'arrow';
74 const LINE_STYLE_ARROW_TYPE_STEALTH
= 'stealth';
75 const LINE_STYLE_ARROW_TYPE_DIAMOND
= 'diamond';
76 const LINE_STYLE_ARROW_TYPE_OVAL
= 'oval';
77 const LINE_STYLE_ARROW_SIZE_1
= 1;
78 const LINE_STYLE_ARROW_SIZE_2
= 2;
79 const LINE_STYLE_ARROW_SIZE_3
= 3;
80 const LINE_STYLE_ARROW_SIZE_4
= 4;
81 const LINE_STYLE_ARROW_SIZE_5
= 5;
82 const LINE_STYLE_ARROW_SIZE_6
= 6;
83 const LINE_STYLE_ARROW_SIZE_7
= 7;
84 const LINE_STYLE_ARROW_SIZE_8
= 8;
85 const LINE_STYLE_ARROW_SIZE_9
= 9;
88 SHADOW_PRESETS_NOSHADOW
= null;
89 const SHADOW_PRESETS_OUTER_BOTTTOM_RIGHT
= 1;
90 const SHADOW_PRESETS_OUTER_BOTTOM
= 2;
91 const SHADOW_PRESETS_OUTER_BOTTOM_LEFT
= 3;
92 const SHADOW_PRESETS_OUTER_RIGHT
= 4;
93 const SHADOW_PRESETS_OUTER_CENTER
= 5;
94 const SHADOW_PRESETS_OUTER_LEFT
= 6;
95 const SHADOW_PRESETS_OUTER_TOP_RIGHT
= 7;
96 const SHADOW_PRESETS_OUTER_TOP
= 8;
97 const SHADOW_PRESETS_OUTER_TOP_LEFT
= 9;
98 const SHADOW_PRESETS_INNER_BOTTTOM_RIGHT
= 10;
99 const SHADOW_PRESETS_INNER_BOTTOM
= 11;
100 const SHADOW_PRESETS_INNER_BOTTOM_LEFT
= 12;
101 const SHADOW_PRESETS_INNER_RIGHT
= 13;
102 const SHADOW_PRESETS_INNER_CENTER
= 14;
103 const SHADOW_PRESETS_INNER_LEFT
= 15;
104 const SHADOW_PRESETS_INNER_TOP_RIGHT
= 16;
105 const SHADOW_PRESETS_INNER_TOP
= 17;
106 const SHADOW_PRESETS_INNER_TOP_LEFT
= 18;
107 const SHADOW_PRESETS_PERSPECTIVE_BELOW
= 19;
108 const SHADOW_PRESETS_PERSPECTIVE_UPPER_RIGHT
= 20;
109 const SHADOW_PRESETS_PERSPECTIVE_UPPER_LEFT
= 21;
110 const SHADOW_PRESETS_PERSPECTIVE_LOWER_RIGHT
= 22;
111 const SHADOW_PRESETS_PERSPECTIVE_LOWER_LEFT
= 23;
114 * @param float $width
118 protected function getExcelPointsWidth($width)
120 return $width * 12700;
124 * @param float $angle
128 protected function getExcelPointsAngle($angle)
130 return $angle * 60000;
133 protected function getTrueAlpha($alpha)
135 return (string) 100 - $alpha . '000';
138 protected function setColorProperties($color, $alpha, $type)
141 'type' => (string) $type,
142 'value' => (string) $color,
143 'alpha' => (string) $this->getTrueAlpha($alpha),
147 protected function getLineStyleArrowSize($array_selector, $array_kay_selector)
150 1 => ['w' => 'sm', 'len' => 'sm'],
151 2 => ['w' => 'sm', 'len' => 'med'],
152 3 => ['w' => 'sm', 'len' => 'lg'],
153 4 => ['w' => 'med', 'len' => 'sm'],
154 5 => ['w' => 'med', 'len' => 'med'],
155 6 => ['w' => 'med', 'len' => 'lg'],
156 7 => ['w' => 'lg', 'len' => 'sm'],
157 8 => ['w' => 'lg', 'len' => 'med'],
158 9 => ['w' => 'lg', 'len' => 'lg'],
161 return $sizes[$array_selector][$array_kay_selector];
164 protected function getShadowPresetsMap($shadow_presets_option)
169 'effect' => 'outerShdw',
171 'distance' => '38100',
172 'direction' => '2700000',
174 'rotWithShape' => '0',
177 'effect' => 'outerShdw',
179 'distance' => '38100',
180 'direction' => '5400000',
182 'rotWithShape' => '0',
185 'effect' => 'outerShdw',
187 'distance' => '38100',
188 'direction' => '8100000',
190 'rotWithShape' => '0',
193 'effect' => 'outerShdw',
195 'distance' => '38100',
197 'rotWithShape' => '0',
200 'effect' => 'outerShdw',
206 'distance' => '38100',
208 'rotWithShape' => '0',
211 'effect' => 'outerShdw',
213 'distance' => '38100',
214 'direction' => '10800000',
216 'rotWithShape' => '0',
219 'effect' => 'outerShdw',
221 'distance' => '38100',
222 'direction' => '18900000',
224 'rotWithShape' => '0',
227 'effect' => 'outerShdw',
229 'distance' => '38100',
230 'direction' => '16200000',
231 'rotWithShape' => '0',
234 'effect' => 'outerShdw',
236 'distance' => '38100',
237 'direction' => '13500000',
239 'rotWithShape' => '0',
243 'effect' => 'innerShdw',
245 'distance' => '50800',
246 'direction' => '2700000',
249 'effect' => 'innerShdw',
251 'distance' => '50800',
252 'direction' => '5400000',
255 'effect' => 'innerShdw',
257 'distance' => '50800',
258 'direction' => '8100000',
261 'effect' => 'innerShdw',
263 'distance' => '50800',
266 'effect' => 'innerShdw',
270 'effect' => 'innerShdw',
272 'distance' => '50800',
273 'direction' => '10800000',
276 'effect' => 'innerShdw',
278 'distance' => '50800',
279 'direction' => '18900000',
282 'effect' => 'innerShdw',
284 'distance' => '50800',
285 'direction' => '16200000',
288 'effect' => 'innerShdw',
290 'distance' => '50800',
291 'direction' => '13500000',
295 'effect' => 'outerShdw',
297 'distance' => '317500',
302 'direction' => '5400000',
303 'rotWithShape' => '0',
306 'effect' => 'outerShdw',
308 'direction' => '18900000',
314 'rotWithShape' => '0',
317 'effect' => 'outerShdw',
319 'direction' => '13500000',
325 'rotWithShape' => '0',
328 'effect' => 'outerShdw',
330 'distance' => '12700',
331 'direction' => '2700000',
337 'rotWithShape' => '0',
340 'effect' => 'outerShdw',
342 'distance' => '12700',
343 'direction' => '8100000',
349 'rotWithShape' => '0',
353 return $presets_options[$shadow_presets_option];
356 protected function getArrayElementsValue($properties, $elements)
358 $reference = &$properties;
359 if (!is_array($elements)) {
360 return $reference[$elements];
363 foreach ($elements as $keys) {
364 $reference = &$reference[$keys];