alignment = new Alignment(); $this->font = new Font(); $this->font->setName('Calibri'); $this->font->setSize(18); } /** * Get Visible. * * @return bool */ public function isVisible() { return $this->visible; } /** * Set Visible. * * @param bool $value * * @return \PhpOffice\PhpPresentation\Shape\Chart\Title */ public function setVisible($value = true) { $this->visible = $value; return $this; } /** * Get Text. * * @return string */ public function getText() { return $this->text; } /** * Set Text. * * @param string $value * * @return \PhpOffice\PhpPresentation\Shape\Chart\Title */ public function setText($value = null) { $this->text = $value; return $this; } /** * Get OffsetX (as a fraction of the chart). */ public function getOffsetX(): float { return $this->offsetX; } /** * Set OffsetX (as a fraction of the chart). */ public function setOffsetX(float $value = 0.01): self { $this->offsetX = $value; return $this; } /** * Get OffsetY (as a fraction of the chart). */ public function getOffsetY(): float { return $this->offsetY; } /** * Set OffsetY (as a fraction of the chart). */ public function setOffsetY(float $pValue = 0.01): self { $this->offsetY = $pValue; return $this; } /** * Get Width (as a fraction of the chart). */ public function getWidth(): float { return $this->width; } /** * Set Width (as a fraction of the chart). */ public function setWidth(float $pValue = 0): self { $this->width = $pValue; return $this; } /** * Get Height (as a fraction of the chart). */ public function getHeight(): float { return $this->height; } /** * Set Height (as a fraction of the chart). */ public function setHeight(float $value = 0): self { $this->height = $value; return $this; } /** * Get font. */ public function getFont(): ?Font { return $this->font; } /** * Set font. * * @param Font|null $pFont Font */ public function setFont(Font $pFont = null): self { $this->font = $pFont; return $this; } /** * Get alignment. * * @return \PhpOffice\PhpPresentation\Style\Alignment */ public function getAlignment() { return $this->alignment; } /** * Set alignment. * * @return \PhpOffice\PhpPresentation\Shape\Chart\Title */ public function setAlignment(Alignment $alignment) { $this->alignment = $alignment; return $this; } /** * Get hash code. * * @return string Hash code */ public function getHashCode(): string { return \md5($this->text . $this->offsetX . $this->offsetY . $this->width . $this->height . $this->font->getHashCode() . $this->alignment->getHashCode() . ($this->visible ? 't' : 'f') . __CLASS__); } /** * Get hash index. * * Note that this index may vary during script execution! Only reliable moment is * while doing a write of a workbook and when changes are not allowed. * * @return int|null Hash index */ public function getHashIndex(): ?int { return $this->hashIndex; } /** * Set hash index. * * Note that this index may vary during script execution! Only reliable moment is * while doing a write of a workbook and when changes are not allowed. * * @param int $value Hash index * * @return Title */ public function setHashIndex(int $value) { $this->hashIndex = $value; return $this; } }