暂无描述

Chart.php 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <?php
  2. /**
  3. * This file is part of PHPWord - A pure PHP library for reading and writing
  4. * word processing documents.
  5. *
  6. * PHPWord is free software distributed under the terms of the GNU Lesser
  7. * General Public License version 3 as published by the Free Software Foundation.
  8. *
  9. * For the full copyright and license information, please read the LICENSE
  10. * file that was distributed with this source code. For the full list of
  11. * contributors, visit https://github.com/PHPOffice/PHPWord/contributors.
  12. *
  13. * @link https://github.com/PHPOffice/PHPWord
  14. * @copyright 2010-2014 PHPWord contributors
  15. * @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
  16. */
  17. namespace PhpOffice\PhpWord\Style;
  18. /**
  19. * Chart style
  20. *
  21. * @since 0.12.0
  22. */
  23. class Chart extends AbstractStyle
  24. {
  25. /**
  26. * Width (in EMU)
  27. *
  28. * @var int
  29. */
  30. private $width = 1000000;
  31. /**
  32. * Height (in EMU)
  33. *
  34. * @var int
  35. */
  36. private $height = 1000000;
  37. /**
  38. * Is 3D; applies to pie, bar, line, area
  39. *
  40. * @var bool
  41. */
  42. private $is3d = false;
  43. /**
  44. * Create a new instance
  45. *
  46. * @param array $style
  47. */
  48. public function __construct($style = array())
  49. {
  50. $this->setStyleByArray($style);
  51. }
  52. /**
  53. * Get width
  54. *
  55. * @return int
  56. */
  57. public function getWidth()
  58. {
  59. return $this->width;
  60. }
  61. /**
  62. * Set width
  63. *
  64. * @param int $value
  65. * @return self
  66. */
  67. public function setWidth($value = null)
  68. {
  69. $this->width = $this->setIntVal($value, $this->width);
  70. return $this;
  71. }
  72. /**
  73. * Get height
  74. *
  75. * @return int
  76. */
  77. public function getHeight()
  78. {
  79. return $this->height;
  80. }
  81. /**
  82. * Set height
  83. *
  84. * @param int $value
  85. * @return self
  86. */
  87. public function setHeight($value = null)
  88. {
  89. $this->height = $this->setIntVal($value, $this->height);
  90. return $this;
  91. }
  92. /**
  93. * Is 3D
  94. *
  95. * @return bool
  96. */
  97. public function is3d()
  98. {
  99. return $this->is3d;
  100. }
  101. /**
  102. * Set 3D
  103. *
  104. * @param bool $value
  105. * @return self
  106. */
  107. public function set3d($value = true)
  108. {
  109. $this->is3d = $this->setBoolVal($value, $this->is3d);
  110. return $this;
  111. }
  112. }