如何在PHP Presentation上的YAxis绘图标签上更改字体。有问题吗?

时间:2018-07-04 19:16:32

标签: php phpoffice phppowerpoint phppresentation

我正在尝试将Y轴绘图标签(全部1,已完成1 ...)的字体从默认的Calibri更改为Arial,但是由于某种原因,它没有改变,尽管图表上的其他所有内容更改为Arial。导出的格式为Powerpoint 2007(.pptx) 我检查了所有PHPPresentation API,并在GitHub中使用了最新的API。我可能在想

$shape->getPlotArea()->getAxisY()->getFont()->setName('Arial');

可以,但是看起来好像不可以。有人猜吗?帮助可能会丢失的家伙。感谢您的帮助...

$barChart = new Bar(); 
$barChart->setBarDirection(Bar::DIRECTION_HORIZONTAL);
$seriesData = array('All 1' => 10,'Completed 1' => 5 ,'All 2' => 5,'Completed 2' => 5 );
$series = new Series('2009', $seriesData);
$series->setShowSeriesName(false);
$series->setShowValue(true);
$series->getFont()->setName('Arial');
$series->setLabelPosition(Series::LABEL_OUTSIDEEND);
$series->getDataPointFill(3)->setFillType(Fill::FILL_SOLID)->setStartColor(new Color('FFFF0913'));
$series->getDataPointFill(2)->setFillType(Fill::FILL_SOLID)->setStartColor(new Color('FFFF65C7'));
$series->getDataPointFill(1)->setFillType(Fill::FILL_SOLID)->setStartColor(new Color('FF2740FF'));  
$series->getDataPointFill(0)->setFillType(Fill::FILL_SOLID)->setStartColor(new Color('FF518DF9'));
$barChart->addSeries($series);
$shape = $slide->createChartShape();
$shape->setName('Completion Data')->setResizeProportional(false)->setHeight(200)->setWidth(550)->setOffsetX(50)->setOffsetY(450);    
$shape->setFill($oFill);
$shape->getBorder()->setLineStyle(Border::LINE_SINGLE)->setLineWidth(0.5); 
$shape->getPlotArea()->getAxisY()->setTitle("");
$shape->getPlotArea()->getAxisY()->setMajorGridlines($oGridLines);
$shape->getPlotArea()->getAxisY()->getFont()->setName('Arial'); 
$shape->getPlotArea()->getAxisX()->getFont()->setName('Arial'); 
$shape->getPlotArea()->getAxisX()->setTitle("");    
$shape->getTitle()->setText(' ');
$shape->getPlotArea()->setType($barChart);
$shape->getLegend()->setVisible(0);

0 个答案:

没有答案