首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PHPOffice/PowerPoint:如何使用setDisplayBlankAs()图表方法?

PHPOffice/PowerPoint:如何使用setDisplayBlankAs()图表方法?
EN

Stack Overflow用户
提问于 2022-08-05 14:30:01
回答 1查看 16关注 0票数 0

我尝试使用setDisplayBlankAs()方法,如文档中所示:

但我有个错误:

PhpOffice\PhpPresentation\Shape\Chart\Type\Line::setDisplayBlankAs() {“异常”:“对象(错误(代码: 0):调用未定义方法PhpOffice\PhpPresentation\Shape\Chart\Type\Line::setDisplayBlankAs() at.

此错误可能表示缺少该方法。我想知道我的代码有什么问题:

代码语言:javascript
复制
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。

EN

回答 1

Stack Overflow用户

发布于 2022-08-05 14:51:58

找到了。方法在形状内:

代码语言:javascript
复制
$oShape->setDisplayBlankAs(Chart::BLANKAS_GAP);
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73251356

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档