0

I tried to use setDisplayBlankAs() method as shown in documentation at:

https://phpoffice.github.io/PHPPresentation/usage/shapes/chart.html#customization

but I got an error:

PhpOffice\PhpPresentation\Shape\Chart\Type\Line::setDisplayBlankAs() {"exception":"[object] (Error(code: 0): Call to undefined method PhpOffice\PhpPresentation\Shape\Chart\Type\Line::setDisplayBlankAs() at...

This error likely says the method is missing. I wonder what is wrong with my code:

use PhpOffice\PhpPresentation\Shape\Chart;
// ...
$lineChart = new Chart\Type\Line();
$lineChart->setDisplayBlankAs(Chart::BLANKAS_GAP);
$lineChart->addSeries($series);
$oShape = $currentSlide->createChartShape();
$oShape->getPlotArea()->setType($lineChart);
// ... etc.

Without the line with setDisplayBlankAs() method my code works as expected.
Latest PHPOffice/PHPPresentation installed via Composer about a month ago.

Vlado
  • 3,517
  • 2
  • 26
  • 24

1 Answers1

0

Found it. Method is inside the Shape:

$oShape->setDisplayBlankAs(Chart::BLANKAS_GAP);
Vlado
  • 3,517
  • 2
  • 26
  • 24