@@ -67,7 +67,8 @@ class Chart extends AbstractStyle
67
67
private $ showLegend = false ;
68
68
69
69
/**
70
- * Chart legend Position.
70
+ * Chart legend Position.
71
+ * Possible values are 'r', 't', 'b', 'l', 'tr'
71
72
*
72
73
* @var string
73
74
*/
@@ -240,6 +241,7 @@ public function getColors()
240
241
* Set the colors to use in a chart.
241
242
*
242
243
* @param array $value a list of colors to use in the chart
244
+ * @return self
243
245
*/
244
246
public function setColors ($ value = array ())
245
247
{
@@ -262,6 +264,7 @@ public function getTitle()
262
264
* Set the chart title
263
265
*
264
266
* @param string $value
267
+ * @return self
265
268
*/
266
269
public function setTitle ($ value = null )
267
270
{
@@ -284,6 +287,7 @@ public function isShowLegend()
284
287
* Set chart legend visibility
285
288
*
286
289
* @param bool $value
290
+ * @return self
287
291
*/
288
292
public function setShowLegend ($ value = false )
289
293
{
@@ -312,11 +316,13 @@ public function getLegendPosition()
312
316
*
313
317
* default: right
314
318
*
315
- * @param bool $value
319
+ * @param string $legendPosition
320
+ * @return self
316
321
*/
317
- public function setLegendPosition ($ value = 'r ' )
322
+ public function setLegendPosition ($ legendPosition = 'r ' )
318
323
{
319
- $ this ->legendPosition = $ value ;
324
+ $ enum = array ('r ' , 'b ' , 't ' , 'l ' , 'tr ' );
325
+ $ this ->legendPosition = $ this ->setEnumVal ($ legendPosition , $ enum , $ this ->legendPosition );
320
326
321
327
return $ this ;
322
328
}
@@ -364,7 +370,10 @@ public function setDataLabelOptions($values = array())
364
370
{
365
371
foreach (array_keys ($ this ->dataLabelOptions ) as $ option ) {
366
372
if (isset ($ values [$ option ])) {
367
- $ this ->dataLabelOptions [$ option ] = $ this ->setBoolVal ($ values [$ option ], $ this ->dataLabelOptions [$ option ]);
373
+ $ this ->dataLabelOptions [$ option ] = $ this ->setBoolVal (
374
+ $ values [$ option ],
375
+ $ this ->dataLabelOptions [$ option ]
376
+ );
368
377
}
369
378
}
370
379
}
0 commit comments