ea82db60ade5a6b33ebd79fcf864d00eb18fea19.svn-base 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  1. <?php
  2. /**
  3. * PHPExcel
  4. *
  5. * Copyright (c) 2006 - 2014 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 - 2014 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 - 2014 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. * @return PHPExcel_Chart_Layout
  152. */
  153. public function setLayoutTarget($value) {
  154. $this->_layoutTarget = $value;
  155. return $this;
  156. }
  157. /**
  158. * Get X-Mode
  159. *
  160. * @return string
  161. */
  162. public function getXMode() {
  163. return $this->_xMode;
  164. }
  165. /**
  166. * Set X-Mode
  167. *
  168. * @param X-Mode $value
  169. * @return PHPExcel_Chart_Layout
  170. */
  171. public function setXMode($value) {
  172. $this->_xMode = $value;
  173. return $this;
  174. }
  175. /**
  176. * Get Y-Mode
  177. *
  178. * @return string
  179. */
  180. public function getYMode() {
  181. return $this->_yMode;
  182. }
  183. /**
  184. * Set Y-Mode
  185. *
  186. * @param Y-Mode $value
  187. * @return PHPExcel_Chart_Layout
  188. */
  189. public function setYMode($value) {
  190. $this->_yMode = $value;
  191. return $this;
  192. }
  193. /**
  194. * Get X-Position
  195. *
  196. * @return number
  197. */
  198. public function getXPosition() {
  199. return $this->_xPos;
  200. }
  201. /**
  202. * Set X-Position
  203. *
  204. * @param X-Position $value
  205. * @return PHPExcel_Chart_Layout
  206. */
  207. public function setXPosition($value) {
  208. $this->_xPos = $value;
  209. return $this;
  210. }
  211. /**
  212. * Get Y-Position
  213. *
  214. * @return number
  215. */
  216. public function getYPosition() {
  217. return $this->_yPos;
  218. }
  219. /**
  220. * Set Y-Position
  221. *
  222. * @param Y-Position $value
  223. * @return PHPExcel_Chart_Layout
  224. */
  225. public function setYPosition($value) {
  226. $this->_yPos = $value;
  227. return $this;
  228. }
  229. /**
  230. * Get Width
  231. *
  232. * @return number
  233. */
  234. public function getWidth() {
  235. return $this->_width;
  236. }
  237. /**
  238. * Set Width
  239. *
  240. * @param Width $value
  241. * @return PHPExcel_Chart_Layout
  242. */
  243. public function setWidth($value) {
  244. $this->_width = $value;
  245. return $this;
  246. }
  247. /**
  248. * Get Height
  249. *
  250. * @return number
  251. */
  252. public function getHeight() {
  253. return $this->_height;
  254. }
  255. /**
  256. * Set Height
  257. *
  258. * @param Height $value
  259. * @return PHPExcel_Chart_Layout
  260. */
  261. public function setHeight($value) {
  262. $this->_height = $value;
  263. return $this;
  264. }
  265. /**
  266. * Get show legend key
  267. *
  268. * @return boolean
  269. */
  270. public function getShowLegendKey() {
  271. return $this->_showLegendKey;
  272. }
  273. /**
  274. * Set show legend key
  275. * Specifies that legend keys should be shown in data labels.
  276. *
  277. * @param boolean $value Show legend key
  278. * @return PHPExcel_Chart_Layout
  279. */
  280. public function setShowLegendKey($value) {
  281. $this->_showLegendKey = $value;
  282. return $this;
  283. }
  284. /**
  285. * Get show value
  286. *
  287. * @return boolean
  288. */
  289. public function getShowVal() {
  290. return $this->_showVal;
  291. }
  292. /**
  293. * Set show val
  294. * Specifies that the value should be shown in data labels.
  295. *
  296. * @param boolean $value Show val
  297. * @return PHPExcel_Chart_Layout
  298. */
  299. public function setShowVal($value) {
  300. $this->_showVal = $value;
  301. return $this;
  302. }
  303. /**
  304. * Get show category name
  305. *
  306. * @return boolean
  307. */
  308. public function getShowCatName() {
  309. return $this->_showCatName;
  310. }
  311. /**
  312. * Set show cat name
  313. * Specifies that the category name should be shown in data labels.
  314. *
  315. * @param boolean $value Show cat name
  316. * @return PHPExcel_Chart_Layout
  317. */
  318. public function setShowCatName($value) {
  319. $this->_showCatName = $value;
  320. return $this;
  321. }
  322. /**
  323. * Get show data series name
  324. *
  325. * @return boolean
  326. */
  327. public function getShowSerName() {
  328. return $this->_showSerName;
  329. }
  330. /**
  331. * Set show ser name
  332. * Specifies that the series name should be shown in data labels.
  333. *
  334. * @param boolean $value Show series name
  335. * @return PHPExcel_Chart_Layout
  336. */
  337. public function setShowSerName($value) {
  338. $this->_showSerName = $value;
  339. return $this;
  340. }
  341. /**
  342. * Get show percentage
  343. *
  344. * @return boolean
  345. */
  346. public function getShowPercent() {
  347. return $this->_showPercent;
  348. }
  349. /**
  350. * Set show percentage
  351. * Specifies that the percentage should be shown in data labels.
  352. *
  353. * @param boolean $value Show percentage
  354. * @return PHPExcel_Chart_Layout
  355. */
  356. public function setShowPercent($value) {
  357. $this->_showPercent = $value;
  358. return $this;
  359. }
  360. /**
  361. * Get show bubble size
  362. *
  363. * @return boolean
  364. */
  365. public function getShowBubbleSize() {
  366. return $this->_showBubbleSize;
  367. }
  368. /**
  369. * Set show bubble size
  370. * Specifies that the bubble size should be shown in data labels.
  371. *
  372. * @param boolean $value Show bubble size
  373. * @return PHPExcel_Chart_Layout
  374. */
  375. public function setShowBubbleSize($value) {
  376. $this->_showBubbleSize = $value;
  377. return $this;
  378. }
  379. /**
  380. * Get show leader lines
  381. *
  382. * @return boolean
  383. */
  384. public function getShowLeaderLines() {
  385. return $this->_showLeaderLines;
  386. }
  387. /**
  388. * Set show leader lines
  389. * Specifies that leader lines should be shown in data labels.
  390. *
  391. * @param boolean $value Show leader lines
  392. * @return PHPExcel_Chart_Layout
  393. */
  394. public function setShowLeaderLines($value) {
  395. $this->_showLeaderLines = $value;
  396. return $this;
  397. }
  398. }