00001 <?php 00002 /*************************************************************************** 00003 * Copyright (C) 2008-2009 by Denis M. Gabaidulin * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU Lesser General Public License as * 00007 * published by the Free Software Foundation; either version 3 of the * 00008 * License, or (at your option) any later version. * 00009 * * 00010 ***************************************************************************/ 00011 00015 class GoogleChartLabel extends BaseGoogleChartParameter 00016 { 00017 protected $name = 'chl'; 00018 00019 protected $labels = array(); 00020 00024 public static function create() 00025 { 00026 return new self; 00027 } 00028 00032 public function addLabel($label) 00033 { 00034 $this->labels[] = $label; 00035 00036 return $this; 00037 } 00038 00042 public function setLabels($labels) 00043 { 00044 $this->labels = $labels; 00045 00046 return $this; 00047 } 00048 00049 public function getCount() 00050 { 00051 return count($this->labels); 00052 } 00053 00054 public function toString() 00055 { 00056 $labels = implode('|', $this->labels); 00057 00058 return $this->name.'='.$labels; 00059 } 00060 } 00061 ?>