Layout.php 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. <?php
  2. /**
  3. * PHPExcel
  4. *
  5. * Copyright (c) 2006 - 2015 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 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
  24. * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
  25. * @version ##VERSION##, ##DATE##
  26. */
  27. /**
  28. * PHPExcel_Chart_Layout
  29. *
  30. * @category PHPExcel
  31. * @package PHPExcel_Chart
  32. * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
  33. */
  34. class PHPExcel_Chart_Layout
  35. {
  36. /**
  37. * layoutTarget
  38. *
  39. * @var string
  40. */
  41. private $layoutTarget;
  42. /**
  43. * X Mode
  44. *
  45. * @var string
  46. */
  47. private $xMode;
  48. /**
  49. * Y Mode
  50. *
  51. * @var string
  52. */
  53. private $yMode;
  54. /**
  55. * X-Position
  56. *
  57. * @var float
  58. */
  59. private $xPos;
  60. /**
  61. * Y-Position
  62. *
  63. * @var float
  64. */
  65. private $yPos;
  66. /**
  67. * width
  68. *
  69. * @var float
  70. */
  71. private $width;
  72. /**
  73. * height
  74. *
  75. * @var float
  76. */
  77. private $height;
  78. /**
  79. * show legend key
  80. * Specifies that legend keys should be shown in data labels
  81. *
  82. * @var boolean
  83. */
  84. private $showLegendKey;
  85. /**
  86. * show value
  87. * Specifies that the value should be shown in a data label.
  88. *
  89. * @var boolean
  90. */
  91. private $showVal;
  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;
  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;
  106. /**
  107. * show percentage
  108. * Specifies that the percentage should be shown in the data label.
  109. *
  110. * @var boolean
  111. */
  112. private $showPercent;
  113. /**
  114. * show bubble size
  115. *
  116. * @var boolean
  117. */
  118. private $showBubbleSize;
  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;
  126. /**
  127. * Create a new PHPExcel_Chart_Layout
  128. */
  129. public function __construct($layout = array())
  130. {
  131. if (isset($layout['layoutTarget'])) {
  132. $this->layoutTarget = $layout['layoutTarget'];
  133. }
  134. if (isset($layout['xMode'])) {
  135. $this->xMode = $layout['xMode'];
  136. }
  137. if (isset($layout['yMode'])) {
  138. $this->yMode = $layout['yMode'];
  139. }
  140. if (isset($layout['x'])) {
  141. $this->xPos = (float) $layout['x'];
  142. }
  143. if (isset($layout['y'])) {
  144. $this->yPos = (float) $layout['y'];
  145. }
  146. if (isset($layout['w'])) {
  147. $this->width = (float) $layout['w'];
  148. }
  149. if (isset($layout['h'])) {
  150. $this->height = (float) $layout['h'];
  151. }
  152. }
  153. /**
  154. * Get Layout Target
  155. *
  156. * @return string
  157. */
  158. public function getLayoutTarget()
  159. {
  160. return $this->layoutTarget;
  161. }
  162. /**
  163. * Set Layout Target
  164. *
  165. * @param Layout Target $value
  166. * @return PHPExcel_Chart_Layout
  167. */
  168. public function setLayoutTarget($value)
  169. {
  170. $this->layoutTarget = $value;
  171. return $this;
  172. }
  173. /**
  174. * Get X-Mode
  175. *
  176. * @return string
  177. */
  178. public function getXMode()
  179. {
  180. return $this->xMode;
  181. }
  182. /**
  183. * Set X-Mode
  184. *
  185. * @param X-Mode $value
  186. * @return PHPExcel_Chart_Layout
  187. */
  188. public function setXMode($value)
  189. {
  190. $this->xMode = $value;
  191. return $this;
  192. }
  193. /**
  194. * Get Y-Mode
  195. *
  196. * @return string
  197. */
  198. public function getYMode()
  199. {
  200. return $this->yMode;
  201. }
  202. /**
  203. * Set Y-Mode
  204. *
  205. * @param Y-Mode $value
  206. * @return PHPExcel_Chart_Layout
  207. */
  208. public function setYMode($value)
  209. {
  210. $this->yMode = $value;
  211. return $this;
  212. }
  213. /**
  214. * Get X-Position
  215. *
  216. * @return number
  217. */
  218. public function getXPosition()
  219. {
  220. return $this->xPos;
  221. }
  222. /**
  223. * Set X-Position
  224. *
  225. * @param X-Position $value
  226. * @return PHPExcel_Chart_Layout
  227. */
  228. public function setXPosition($value)
  229. {
  230. $this->xPos = $value;
  231. return $this;
  232. }
  233. /**
  234. * Get Y-Position
  235. *
  236. * @return number
  237. */
  238. public function getYPosition()
  239. {
  240. return $this->yPos;
  241. }
  242. /**
  243. * Set Y-Position
  244. *
  245. * @param Y-Position $value
  246. * @return PHPExcel_Chart_Layout
  247. */
  248. public function setYPosition($value)
  249. {
  250. $this->yPos = $value;
  251. return $this;
  252. }
  253. /**
  254. * Get Width
  255. *
  256. * @return number
  257. */
  258. public function getWidth()
  259. {
  260. return $this->width;
  261. }
  262. /**
  263. * Set Width
  264. *
  265. * @param Width $value
  266. * @return PHPExcel_Chart_Layout
  267. */
  268. public function setWidth($value)
  269. {
  270. $this->width = $value;
  271. return $this;
  272. }
  273. /**
  274. * Get Height
  275. *
  276. * @return number
  277. */
  278. public function getHeight()
  279. {
  280. return $this->height;
  281. }
  282. /**
  283. * Set Height
  284. *
  285. * @param Height $value
  286. * @return PHPExcel_Chart_Layout
  287. */
  288. public function setHeight($value)
  289. {
  290. $this->height = $value;
  291. return $this;
  292. }
  293. /**
  294. * Get show legend key
  295. *
  296. * @return boolean
  297. */
  298. public function getShowLegendKey()
  299. {
  300. return $this->showLegendKey;
  301. }
  302. /**
  303. * Set show legend key
  304. * Specifies that legend keys should be shown in data labels.
  305. *
  306. * @param boolean $value Show legend key
  307. * @return PHPExcel_Chart_Layout
  308. */
  309. public function setShowLegendKey($value)
  310. {
  311. $this->showLegendKey = $value;
  312. return $this;
  313. }
  314. /**
  315. * Get show value
  316. *
  317. * @return boolean
  318. */
  319. public function getShowVal()
  320. {
  321. return $this->showVal;
  322. }
  323. /**
  324. * Set show val
  325. * Specifies that the value should be shown in data labels.
  326. *
  327. * @param boolean $value Show val
  328. * @return PHPExcel_Chart_Layout
  329. */
  330. public function setShowVal($value)
  331. {
  332. $this->showVal = $value;
  333. return $this;
  334. }
  335. /**
  336. * Get show category name
  337. *
  338. * @return boolean
  339. */
  340. public function getShowCatName()
  341. {
  342. return $this->showCatName;
  343. }
  344. /**
  345. * Set show cat name
  346. * Specifies that the category name should be shown in data labels.
  347. *
  348. * @param boolean $value Show cat name
  349. * @return PHPExcel_Chart_Layout
  350. */
  351. public function setShowCatName($value)
  352. {
  353. $this->showCatName = $value;
  354. return $this;
  355. }
  356. /**
  357. * Get show data series name
  358. *
  359. * @return boolean
  360. */
  361. public function getShowSerName()
  362. {
  363. return $this->showSerName;
  364. }
  365. /**
  366. * Set show ser name
  367. * Specifies that the series name should be shown in data labels.
  368. *
  369. * @param boolean $value Show series name
  370. * @return PHPExcel_Chart_Layout
  371. */
  372. public function setShowSerName($value)
  373. {
  374. $this->showSerName = $value;
  375. return $this;
  376. }
  377. /**
  378. * Get show percentage
  379. *
  380. * @return boolean
  381. */
  382. public function getShowPercent()
  383. {
  384. return $this->showPercent;
  385. }
  386. /**
  387. * Set show percentage
  388. * Specifies that the percentage should be shown in data labels.
  389. *
  390. * @param boolean $value Show percentage
  391. * @return PHPExcel_Chart_Layout
  392. */
  393. public function setShowPercent($value)
  394. {
  395. $this->showPercent = $value;
  396. return $this;
  397. }
  398. /**
  399. * Get show bubble size
  400. *
  401. * @return boolean
  402. */
  403. public function getShowBubbleSize()
  404. {
  405. return $this->showBubbleSize;
  406. }
  407. /**
  408. * Set show bubble size
  409. * Specifies that the bubble size should be shown in data labels.
  410. *
  411. * @param boolean $value Show bubble size
  412. * @return PHPExcel_Chart_Layout
  413. */
  414. public function setShowBubbleSize($value)
  415. {
  416. $this->showBubbleSize = $value;
  417. return $this;
  418. }
  419. /**
  420. * Get show leader lines
  421. *
  422. * @return boolean
  423. */
  424. public function getShowLeaderLines()
  425. {
  426. return $this->showLeaderLines;
  427. }
  428. /**
  429. * Set show leader lines
  430. * Specifies that leader lines should be shown in data labels.
  431. *
  432. * @param boolean $value Show leader lines
  433. * @return PHPExcel_Chart_Layout
  434. */
  435. public function setShowLeaderLines($value)
  436. {
  437. $this->showLeaderLines = $value;
  438. return $this;
  439. }
  440. }