00001 <?php 00002 /*************************************************************************** 00003 * Copyright (C) 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 final class ChartLabelStyle 00016 { 00017 private $type = null; 00018 private $color = null; 00019 private $dataSetIndex = null; 00020 private $size = null; 00021 private $dataPoint = null; 00022 00026 public static function create() 00027 { 00028 return new self; 00029 } 00030 00031 public function __construct() 00032 { 00033 $this->color = Color::create('000000'); 00034 $this->type = GoogleChartLabelStyleNumberType::create(); 00035 $this->size = 10; 00036 $this->dataPoint = -1; 00037 } 00038 00042 public function setType(BaseGoogleChartLabelStyleType $type) 00043 { 00044 $this->type = $type; 00045 00046 return $this; 00047 } 00048 00052 public function getType() 00053 { 00054 return $this->type; 00055 } 00056 00060 public function setColor(Color $color) 00061 { 00062 $this->color = $color; 00063 00064 return $this; 00065 } 00066 00070 public function getColor() 00071 { 00072 return $this->color; 00073 } 00074 00075 public function setDataSetIndex($index) 00076 { 00077 Assert::isInteger($index); 00078 00079 $this->dataSetIndex = $index; 00080 00081 return $this; 00082 } 00083 00084 public function getDataSetIndex() 00085 { 00086 return $this->dataSetIndex; 00087 } 00088 00089 public function setSize($size) 00090 { 00091 Assert::isPositiveInteger($size); 00092 00093 $this->size = $size; 00094 00095 return $this; 00096 } 00097 00098 public function getSize() 00099 { 00100 return $this->size; 00101 } 00102 00103 public function setDataPoint($value) 00104 { 00105 $this->dataPoint = $value; 00106 00107 return $this; 00108 } 00109 00110 public function getDataPoint() 00111 { 00112 return $this->dataPoint; 00113 } 00114 00115 public function toString() 00116 { 00117 Assert::isNotNull($this->dataSetIndex); 00118 Assert::isNotNull($this->size); 00119 00120 return 00121 $this->type->toString() 00122 .','.$this->color->toString() 00123 .','.$this->dataSetIndex 00124 .','.$this->dataPoint 00125 .','.$this->size; 00126 } 00127 } 00128 ?>