| 1 |
<?php |
| 2 |
|
| 3 |
namespace PhpOffice\PhpSpreadsheet\Chart; |
| 4 |
|
| 5 |
use PhpOffice\PhpSpreadsheet\Style\Font; |
| 6 |
|
| 7 |
class AxisText extends Properties |
| 8 |
{ |
| 9 |
/** @var ?int */ |
| 10 |
private $rotation; |
| 11 |
|
| 12 |
/** @var Font */ |
| 13 |
private $font; |
| 14 |
|
| 15 |
public function __construct() |
| 16 |
{ |
| 17 |
parent::__construct(); |
| 18 |
$this->font = new Font(); |
| 19 |
$this->font->setSize(null, true); |
| 20 |
} |
| 21 |
|
| 22 |
public function setRotation(?int $rotation): self |
| 23 |
{ |
| 24 |
$this->rotation = $rotation; |
| 25 |
|
| 26 |
return $this; |
| 27 |
} |
| 28 |
|
| 29 |
public function getRotation(): ?int |
| 30 |
{ |
| 31 |
return $this->rotation; |
| 32 |
} |
| 33 |
|
| 34 |
public function getFillColorObject(): ChartColor |
| 35 |
{ |
| 36 |
$fillColor = $this->font->getChartColor(); |
| 37 |
if ($fillColor === null) { |
| 38 |
$fillColor = new ChartColor(); |
| 39 |
$this->font->setChartColorFromObject($fillColor); |
| 40 |
} |
| 41 |
|
| 42 |
return $fillColor; |
| 43 |
} |
| 44 |
|
| 45 |
public function getFont(): Font |
| 46 |
{ |
| 47 |
return $this->font; |
| 48 |
} |
| 49 |
|
| 50 |
public function setFont(Font $font): self |
| 51 |
{ |
| 52 |
$this->font = $font; |
| 53 |
|
| 54 |
return $this; |
| 55 |
} |
| 56 |
} |
| 57 |
|