1 | <?php |
||
32 | class DataSeriesValues |
||
33 | { |
||
34 | const DATASERIES_TYPE_STRING = 'String'; |
||
35 | const DATASERIES_TYPE_NUMBER = 'Number'; |
||
36 | |||
37 | private static $dataTypeValues = [ |
||
38 | self::DATASERIES_TYPE_STRING, |
||
39 | self::DATASERIES_TYPE_NUMBER, |
||
40 | ]; |
||
41 | |||
42 | /** |
||
43 | * Series Data Type. |
||
44 | * |
||
45 | * @var string |
||
46 | */ |
||
47 | private $dataType; |
||
48 | |||
49 | /** |
||
50 | * Series Data Source. |
||
51 | * |
||
52 | * @var string |
||
53 | */ |
||
54 | private $dataSource; |
||
55 | |||
56 | /** |
||
57 | * Format Code. |
||
58 | * |
||
59 | * @var string |
||
60 | */ |
||
61 | private $formatCode; |
||
62 | |||
63 | /** |
||
64 | * Series Point Marker. |
||
65 | * |
||
66 | * @var string |
||
67 | */ |
||
68 | private $pointMarker; |
||
69 | |||
70 | /** |
||
71 | * Point Count (The number of datapoints in the dataseries). |
||
72 | * |
||
73 | * @var int |
||
74 | */ |
||
75 | private $pointCount = 0; |
||
76 | |||
77 | /** |
||
78 | * Data Values. |
||
79 | * |
||
80 | * @var array of mixed |
||
81 | */ |
||
82 | private $dataValues = []; |
||
83 | |||
84 | /** |
||
85 | * Fill color. |
||
86 | * |
||
87 | * @var string |
||
88 | */ |
||
89 | private $fillColor; |
||
90 | |||
91 | /** |
||
92 | * Create a new DataSeriesValues object. |
||
93 | * |
||
94 | * |
||
95 | * @param mixed $dataType |
||
96 | * @param string $dataSource |
||
97 | * @param null|mixed $formatCode |
||
98 | * @param mixed $pointCount |
||
99 | * @param mixed $dataValues |
||
100 | * @param null|mixed $marker |
||
101 | * @param null|string $fillColor |
||
102 | */ |
||
103 | 17 | public function __construct($dataType = self::DATASERIES_TYPE_NUMBER, $dataSource = null, $formatCode = null, $pointCount = 0, $dataValues = [], $marker = null, $fillColor = null) |
|
113 | |||
114 | /** |
||
115 | * Get Series Data Type. |
||
116 | * |
||
117 | * @return string |
||
118 | */ |
||
119 | 1 | public function getDataType() |
|
123 | |||
124 | /** |
||
125 | * Set Series Data Type. |
||
126 | * |
||
127 | * @param string $dataType Datatype of this data series |
||
128 | * Typical values are: |
||
129 | * DataSeriesValues::DATASERIES_TYPE_STRING |
||
130 | * Normally used for axis point values |
||
131 | * DataSeriesValues::DATASERIES_TYPE_NUMBER |
||
132 | * Normally used for chart data values |
||
133 | * |
||
134 | * @throws Exception |
||
135 | * |
||
136 | * @return DataSeriesValues |
||
137 | */ |
||
138 | 17 | public function setDataType($dataType) |
|
147 | |||
148 | /** |
||
149 | * Get Series Data Source (formula). |
||
150 | * |
||
151 | * @return string |
||
152 | */ |
||
153 | 13 | public function getDataSource() |
|
157 | |||
158 | /** |
||
159 | * Set Series Data Source (formula). |
||
160 | * |
||
161 | * @param string $dataSource |
||
162 | * |
||
163 | * @return DataSeriesValues |
||
164 | */ |
||
165 | public function setDataSource($dataSource) |
||
171 | |||
172 | /** |
||
173 | * Get Point Marker. |
||
174 | * |
||
175 | * @return string |
||
176 | */ |
||
177 | 13 | public function getPointMarker() |
|
181 | |||
182 | /** |
||
183 | * Set Point Marker. |
||
184 | * |
||
185 | * @param string $marker |
||
186 | * |
||
187 | * @return DataSeriesValues |
||
188 | */ |
||
189 | public function setPointMarker($marker) |
||
195 | |||
196 | /** |
||
197 | * Get Series Format Code. |
||
198 | * |
||
199 | * @return string |
||
200 | */ |
||
201 | 12 | public function getFormatCode() |
|
205 | |||
206 | /** |
||
207 | * Set Series Format Code. |
||
208 | * |
||
209 | * @param string $formatCode |
||
210 | * |
||
211 | * @return DataSeriesValues |
||
212 | */ |
||
213 | public function setFormatCode($formatCode) |
||
219 | |||
220 | /** |
||
221 | * Get Series Point Count. |
||
222 | * |
||
223 | * @return int |
||
224 | */ |
||
225 | 13 | public function getPointCount() |
|
229 | |||
230 | /** |
||
231 | * Get fill color. |
||
232 | * |
||
233 | * @return string HEX color |
||
234 | */ |
||
235 | 13 | public function getFillColor() |
|
239 | |||
240 | /** |
||
241 | * Set fill color for series. |
||
242 | * |
||
243 | * @param string $color HEX color |
||
244 | * |
||
245 | * @return DataSeriesValues |
||
246 | */ |
||
247 | public function setFillColor($color) |
||
256 | |||
257 | /** |
||
258 | * Identify if the Data Series is a multi-level or a simple series. |
||
259 | * |
||
260 | * @return bool|null |
||
261 | */ |
||
262 | 13 | public function isMultiLevelSeries() |
|
270 | |||
271 | /** |
||
272 | * Return the level count of a multi-level Data Series. |
||
273 | * |
||
274 | * @return int |
||
275 | */ |
||
276 | 2 | public function multiLevelCount() |
|
285 | |||
286 | /** |
||
287 | * Get Series Data Values. |
||
288 | * |
||
289 | * @return array of mixed |
||
290 | */ |
||
291 | 13 | public function getDataValues() |
|
295 | |||
296 | /** |
||
297 | * Get the first Series Data value. |
||
298 | * |
||
299 | * @return mixed |
||
300 | */ |
||
301 | public function getDataValue() |
||
312 | |||
313 | /** |
||
314 | * Set Series Data Values. |
||
315 | * |
||
316 | * @param array $dataValues |
||
317 | * |
||
318 | * @return DataSeriesValues |
||
319 | */ |
||
320 | public function setDataValues($dataValues) |
||
327 | |||
328 | 13 | public function refresh(Worksheet $worksheet, $flatten = true) |
|
374 | } |
||
375 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..