Layout.php 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. <?php
  2. /**
  3. * PHPExcel
  4. *
  5. * Copyright (c) 2006 - 2013 PHPExcel
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this library; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. *
  21. * @category PHPExcel
  22. * @package PHPExcel_Chart
  23. * @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
  24. * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
  25. * @version 1.7.9, 2013-06-02
  26. */
  27. /**
  28. * PHPExcel_Chart_Layout
  29. *
  30. * @category PHPExcel
  31. * @package PHPExcel_Chart
  32. * @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
  33. */
  34. class PHPExcel_Chart_Layout
  35. {
  36. /**
  37. * layoutTarget
  38. *
  39. * @var string
  40. */
  41. private $_layoutTarget = NULL;
  42. /**
  43. * X Mode
  44. *
  45. * @var string
  46. */
  47. private $_xMode = NULL;
  48. /**
  49. * Y Mode
  50. *
  51. * @var string
  52. */
  53. private $_yMode = NULL;
  54. /**
  55. * X-Position
  56. *
  57. * @var float
  58. */
  59. private $_xPos = NULL;
  60. /**
  61. * Y-Position
  62. *
  63. * @var float
  64. */
  65. private $_yPos = NULL;
  66. /**
  67. * width
  68. *
  69. * @var float
  70. */
  71. private $_width = NULL;
  72. /**
  73. * height
  74. *
  75. * @var float
  76. */
  77. private $_height = NULL;
  78. /**
  79. * show legend key
  80. * Specifies that legend keys should be shown in data labels
  81. *
  82. * @var boolean
  83. */
  84. private $_showLegendKey = NULL;
  85. /**
  86. * show value
  87. * Specifies that the value should be shown in a data label.
  88. *
  89. * @var boolean
  90. */
  91. private $_showVal = NULL;
  92. /**
  93. * show category name
  94. * Specifies that the category name should be shown in the data label.
  95. *
  96. * @var boolean
  97. */
  98. private $_showCatName = NULL;
  99. /**
  100. * show data series name
  101. * Specifies that the series name should be shown in the data label.
  102. *
  103. * @var boolean
  104. */
  105. private $_showSerName = NULL;
  106. /**
  107. * show percentage
  108. * Specifies that the percentage should be shown in the data label.
  109. *
  110. * @var boolean
  111. */
  112. private $_showPercent = NULL;
  113. /**
  114. * show bubble size
  115. *
  116. * @var boolean
  117. */
  118. private $_showBubbleSize = NULL;
  119. /**
  120. * show leader lines
  121. * Specifies that leader lines should be shown for the data label.
  122. *
  123. * @var boolean
  124. */
  125. private $_showLeaderLines = NULL;
  126. /**
  127. * Create a new PHPExcel_Chart_Layout
  128. */
  129. public function __construct($layout=array())
  130. {
  131. if (isset($layout['layoutTarget'])) { $this->_layoutTarget = $layout['layoutTarget']; }
  132. if (isset($layout['xMode'])) { $this->_xMode = $layout['xMode']; }
  133. if (isset($layout['yMode'])) { $this->_yMode = $layout['yMode']; }
  134. if (isset($layout['x'])) { $this->_xPos = (float) $layout['x']; }
  135. if (isset($layout['y'])) { $this->_yPos = (float) $layout['y']; }
  136. if (isset($layout['w'])) { $this->_width = (float) $layout['w']; }
  137. if (isset($layout['h'])) { $this->_height = (float) $layout['h']; }
  138. }
  139. /**
  140. * Get Layout Target
  141. *
  142. * @return string
  143. */
  144. public function getLayoutTarget() {
  145. return $this->_layoutTarget;
  146. }
  147. /**
  148. * Set Layout Target
  149. *
  150. * @param Layout Target $value
  151. */
  152. public function setLayoutTarget($value) {
  153. $this->_layoutTarget = $value;
  154. }
  155. /**
  156. * Get X-Mode
  157. *
  158. * @return string
  159. */
  160. public function getXMode() {
  161. return $this->_xMode;
  162. }
  163. /**
  164. * Set X-Mode
  165. *
  166. * @param X-Mode $value
  167. */
  168. public function setXMode($value) {
  169. $this->_xMode = $value;
  170. }
  171. /**
  172. * Get Y-Mode
  173. *
  174. * @return string
  175. */
  176. public function getYMode() {
  177. return $this->_xMode;
  178. }
  179. /**
  180. * Set Y-Mode
  181. *
  182. * @param Y-Mode $value
  183. */
  184. public function setYMode($value) {
  185. $this->_xMode = $value;
  186. }
  187. /**
  188. * Get X-Position
  189. *
  190. * @return number
  191. */
  192. public function getXPosition() {
  193. return $this->_xPos;
  194. }
  195. /**
  196. * Set X-Position
  197. *
  198. * @param X-Position $value
  199. */
  200. public function setXPosition($value) {
  201. $this->_xPos = $value;
  202. }
  203. /**
  204. * Get Y-Position
  205. *
  206. * @return number
  207. */
  208. public function getYPosition() {
  209. return $this->_yPos;
  210. }
  211. /**
  212. * Set Y-Position
  213. *
  214. * @param Y-Position $value
  215. */
  216. public function setYPosition($value) {
  217. $this->_yPos = $value;
  218. }
  219. /**
  220. * Get Width
  221. *
  222. * @return number
  223. */
  224. public function getWidth() {
  225. return $this->_width;
  226. }
  227. /**
  228. * Set Width
  229. *
  230. * @param Width $value
  231. */
  232. public function setWidth($value) {
  233. $this->_width = $value;
  234. }
  235. /**
  236. * Get Height
  237. *
  238. * @return number
  239. */
  240. public function getHeight() {
  241. return $this->_height;
  242. }
  243. /**
  244. * Set Height
  245. *
  246. * @param Height $value
  247. */
  248. public function setHeight($value) {
  249. $this->_height = $value;
  250. }
  251. /**
  252. * Get show legend key
  253. *
  254. * @return boolean
  255. */
  256. public function getShowLegendKey() {
  257. return $this->_showLegendKey;
  258. }
  259. /**
  260. * Set show legend key
  261. * Specifies that legend keys should be shown in data labels.
  262. *
  263. * @param boolean $value Show legend key
  264. */
  265. public function setShowLegendKey($value) {
  266. $this->_showLegendKey = $value;
  267. }
  268. /**
  269. * Get show value
  270. *
  271. * @return boolean
  272. */
  273. public function getShowVal() {
  274. return $this->_showVal;
  275. }
  276. /**
  277. * Set show val
  278. * Specifies that the value should be shown in data labels.
  279. *
  280. * @param boolean $value Show val
  281. */
  282. public function setShowVal($value) {
  283. $this->_showVal = $value;
  284. }
  285. /**
  286. * Get show category name
  287. *
  288. * @return boolean
  289. */
  290. public function getShowCatName() {
  291. return $this->_showCatName;
  292. }
  293. /**
  294. * Set show cat name
  295. * Specifies that the category name should be shown in data labels.
  296. *
  297. * @param boolean $value Show cat name
  298. */
  299. public function setShowCatName($value) {
  300. $this->_showCatName = $value;
  301. }
  302. /**
  303. * Get show data series name
  304. *
  305. * @return boolean
  306. */
  307. public function getShowSerName() {
  308. return $this->_showSerName;
  309. }
  310. /**
  311. * Set show ser name
  312. * Specifies that the series name should be shown in data labels.
  313. *
  314. * @param boolean $value Show ser name
  315. */
  316. public function setShowSerName($value) {
  317. $this->_showSerName = $value;
  318. }
  319. /**
  320. * Get show percentage
  321. *
  322. * @return boolean
  323. */
  324. public function getShowPercent() {
  325. return $this->_showPercent;
  326. }
  327. /**
  328. * Set show percentage
  329. * Specifies that the percentage should be shown in data labels.
  330. *
  331. * @param boolean $value Show percentage
  332. */
  333. public function setShowPercent($value) {
  334. $this->_showPercent = $value;
  335. }
  336. /**
  337. * Get show bubble size
  338. *
  339. * @return boolean
  340. */
  341. public function getShowBubbleSize() {
  342. return $this->_showBubbleSize;
  343. }
  344. /**
  345. * Set show bubble size
  346. * Specifies that the bubble size should be shown in data labels.
  347. *
  348. * @param boolean $value Show bubble size
  349. */
  350. public function setShowBubbleSize($value) {
  351. $this->_showBubbleSize = $value;
  352. }
  353. /**
  354. * Get show leader lines
  355. *
  356. * @return boolean
  357. */
  358. public function getShowLeaderLines() {
  359. return $this->_showLeaderLines;
  360. }
  361. /**
  362. * Set show leader lines
  363. * Specifies that leader lines should be shown in data labels.
  364. *
  365. * @param boolean $value Show leader lines
  366. */
  367. public function setShowLeaderLines($value) {
  368. $this->_showLeaderLines = $value;
  369. }
  370. }