PHPPowerPoint从条形图中删除图例

PHPPowerPoint从条形图中删除图例,php,phpexcel,phppowerpoint,Php,Phpexcel,Phppowerpoint,我正在使用PHP导出.ppt文件。直到现在,我才成功地从条形图中删除图例 生成条形图的代码为: $chart1 = new Bar(); $series = new Series('City Distribution', $timeseries); $series->setShowSeriesName(false); $series->setShowValue(true); $series->getFill()->setFillType(Fill::FILL_SOLID)

我正在使用
PHP
导出
.ppt
文件。直到现在,我才成功地从条形图中删除图例

生成条形图的代码为:

$chart1 = new Bar();
$series = new Series('City Distribution', $timeseries);
$series->setShowSeriesName(false);
$series->setShowValue(true);
$series->getFill()->setFillType(Fill::FILL_SOLID)->setStartColor(new Color('FF1dd2af'));

$chart1->addSeries($series);


$gFill =  new Fill();
$gFill->setFillType(Fill::FILL_GRADIENT_PATH)->setRotation(90)->setStartColor(new Color( 'FF1dd2af' ))->setEndColor(new Color( 'FFFFFFFF' ));

$oFill = new Fill();
$oFill->setFillType(Fill::FILL_SOLID)->setStartColor(new Color('FFFFFFFF'));

$oShadow = new Shadow();
$oShadow->setVisible(true)->setDirection(45)->setDistance(10);

// Create a shape (chart)
$shape = $currentSlide->createChartShape();
//$shape->getAlignment()->setVertical( Alignment::VERTICAL_TOP );
$shape->getTitle()->setVisible(false);
$shape->setName('City Distribution')->setResizeProportional(false)->setHeight(300)->setWidth(250)->setOffsetX(25)->setOffsetY(200);
$shape->setFill($oFill);
$shape->getTitle()->setText('City Distribution');
$shape->getTitle()->getFont()->setItalic(true);
$shape->getPlotArea()->getAxisX()->setTitle('City');
$shape->getPlotArea()->getAxisY()->setTitle('Number of Users');
$shape->getPlotArea()->setType($chart1);
$shape->getLegend()->getBorder()->setLineStyle(Border::LINE_SINGLE);
$shape->getLegend()->getFont()->setItalic(true);

这是工作得很好,但它是把一个传奇框,我想删除。有什么想法吗?

不管我是怎么想的,你所需要做的就是:

$shape->getLegend()->setVisible(false);
把它放在下面

$shape->getTitle()->setVisible(false);

不管我怎么想,你所需要做的就是:

$shape->getLegend()->setVisible(false);
把它放在下面

$shape->getTitle()->setVisible(false);