Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

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