我尝试使用setDisplayBlankAs()方法,如文档中所示:
但我有个错误:
PhpOffice\PhpPresentation\Shape\Chart\Type\Line::setDisplayBlankAs() {“异常”:“对象(错误(代码: 0):调用未定义方法PhpOffice\PhpPresentation\Shape\Chart\Type\Line::setDisplayBlankAs() at.
此错误可能表示缺少该方法。我想知道我的代码有什么问题:
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.没有setDisplayBlankAs()方法的行,我的代码就像预期的那样工作。
一个月前,通过Composer安装了最新的PHPOffice/PHPPresentation。
发布于 2022-08-05 14:51:58
找到了。方法在形状内:
$oShape->setDisplayBlankAs(Chart::BLANKAS_GAP);https://stackoverflow.com/questions/73251356
复制相似问题