PHPPresentation icon indicating copy to clipboard operation
PHPPresentation copied to clipboard

How to change font size of chart axis labels?

Open Jaguar1 opened this issue 3 years ago • 3 comments

I am trying to set a different font size (and eventually change also the color) of X and Y axis labels in a chart. My code is like:

$oShape = $currentSlide->createChartShape(); // ..etc. and chart looks good
$oShape->getPlotArea()->getAxisX()->getFont()->setSize(7); // it does nothing

setSize() doesn't set the new value and font size remains the same. No errors or warnings.

Jaguar1 avatar Oct 27 '22 08:10 Jaguar1

Having the same problem with setting the Axis's Font!

LilyEssence avatar Aug 30 '23 15:08 LilyEssence

@Jaguar1 @LilyEssence Which writer do you use ?

Progi1984 avatar Aug 30 '23 17:08 Progi1984

@Jaguar1 @LilyEssence Which writer do you use ?

$oWriterPPTX = IOFactory::createWriter($this->presentation); file path: vendor/phpoffice/phppresentation/src/PhpPresentation/IOFactory.php

I think it defaults to PowerPoint2007, so that's what we're using.

LilyEssence avatar Aug 30 '23 18:08 LilyEssence