@@ -67,7 +67,8 @@ class Chart extends AbstractStyle
6767 private $ showLegend = false ;
6868
6969 /**
70- * Chart legend Position.
70+ * Chart legend Position.
71+ * Possible values are 'r', 't', 'b', 'l', 'tr'
7172 *
7273 * @var string
7374 */
@@ -240,6 +241,7 @@ public function getColors()
240241 * Set the colors to use in a chart.
241242 *
242243 * @param array $value a list of colors to use in the chart
244+ * @return self
243245 */
244246 public function setColors ($ value = array ())
245247 {
@@ -262,6 +264,7 @@ public function getTitle()
262264 * Set the chart title
263265 *
264266 * @param string $value
267+ * @return self
265268 */
266269 public function setTitle ($ value = null )
267270 {
@@ -284,6 +287,7 @@ public function isShowLegend()
284287 * Set chart legend visibility
285288 *
286289 * @param bool $value
290+ * @return self
287291 */
288292 public function setShowLegend ($ value = false )
289293 {
@@ -312,11 +316,13 @@ public function getLegendPosition()
312316 *
313317 * default: right
314318 *
315- * @param bool $value
319+ * @param string $legendPosition
320+ * @return self
316321 */
317- public function setLegendPosition ($ value = 'r ' )
322+ public function setLegendPosition ($ legendPosition = 'r ' )
318323 {
319- $ this ->legendPosition = $ value ;
324+ $ enum = array ('r ' , 'b ' , 't ' , 'l ' , 'tr ' );
325+ $ this ->legendPosition = $ this ->setEnumVal ($ legendPosition , $ enum , $ this ->legendPosition );
320326
321327 return $ this ;
322328 }
@@ -364,7 +370,10 @@ public function setDataLabelOptions($values = array())
364370 {
365371 foreach (array_keys ($ this ->dataLabelOptions ) as $ option ) {
366372 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+ );
368377 }
369378 }
370379 }
0 commit comments