我正在尝试使用此library通过PHP创建PowerPoint演示文稿。当我尝试在PowerPoint中创建图表对象时,当我下载文件并在Microsoft Office中打开图表时,我无法编辑图表。
是否有库可以在PowerPoint文件中构建图表,并允许通过Office PowerPoint对其进行编辑?
Sample Chart created using the above library
发布于 2012-07-29 20:42:15
这很可能是PHP Power Point的一个错误。
但是,最新版本的PHPExcel支持图表功能,并且正在积极维护。它允许您图表和导出您的数据在excel中,可以很容易地复制到PowerPoint。
不过,就个人而言,我建议您使用Google Chart Tools或RaphaelJS。

如果您希望能够在PowerPoint中使用图表,您可以轻松地将Google Charts Data导出到Excel (CSV)。另请参阅this example。
如果你特别介绍谷歌分析,你应该阅读this document关于如何从谷歌分析在PowerPoint中创建一个准确的自动更新的图表和数据。它基本上使用PowerPoint的oomfo plugin。
或者,也有像ShufflePoint这样的付费解决方案。
发布于 2012-12-22 16:55:00
当然,您可以使用PHPPowerPoint导出可编辑图表。在测试中有两个示例。第一个示例不包括Excel工作表,这就是图表不可编辑的原因。但如果你看看第二个例子,我想是test8,你会看到有一个对PHPExcel的引用调用和一个包含数据表和图表的标志,然后你就可以编辑数据了。
发布于 2012-08-01 17:58:34
查看这个url:-
PHP PowerPoint 2007类
该项目为PHP语言提供了一组类,允许您对不同的文件格式进行写入和读取,如PowerPoint 2007,...这个项目是围绕微软的OpenXML标准和PHP构建的。
http://phppowerpoint.codeplex.com/
http://phppowerpoint.codeplex.com/sourcecontrol/list/changesets?ProjectName=phppowerpoint
特性
http://phppowerpoint.codeplex.com/wikipage?title=Features&referringTitle=Home
试试这个:-
<?php
/** Error reporting */
error_reporting(E_ALL);
/** Include path **/
set_include_path(get_include_path() . PATH_SEPARATOR . '/Classes/');
/** PHPPowerPoint */
include 'Classes/PHPPowerPoint.php';
// Create new PHPPowerPoint object
$objPHPPowerPoint = new PHPPowerPoint();
$objPHPPowerPoint->getProperties()->setCreator("Maarten Balliauw")->
setLastModifiedBy("Maarten Balliauw")->setTitle("Office 2007 PPTX Test Document")->
setSubject("Office 2007 PPTX Test Document")->setDescription("Test document for Office 2007 PPTX, generated using PHP classes.")->
setKeywords("office 2007 openxml php")->setCategory("Test result file");
// Remove first slide
$objPHPPowerPoint->removeSlideByIndex(0);
// Create templated slide
// Create templated slide
$currentSlide = createTemplatedSlide($objPHPPowerPoint);
// Generate sample data for line chart
$seriesData = array('Jul 17' => 15, 'Jul 18' => 27, 'Jul 19' => 17, 'Jul 20' =>
11, 'Jul 21' => 7, 'Jul 22' => 2, 'Jul 23' => 8);
// Create a line chart (that should be inserted in a shape)
$lineChart = new PHPPowerPoint_Shape_Chart_Type_Scatter();
$series = new PHPPowerPoint_Shape_Chart_Series('Visits', $seriesData);
//$series->setShowSeriesName(true);
$lineChart->addSeries($series);
// Create a shape (chart)
$shape = $currentSlide->createChartShape();
$shape->setName('# of people visiting your website')->setResizeProportional(false)->setHeight(550)->
setWidth(700)->setOffsetX(120)->setOffsetY(80);
$shape->getShadow()->setVisible(true)->setDirection(45)->setDistance(10);
$shape->getFill()->setFillType(PHPPowerPoint_Style_Fill::FILL_GRADIENT_LINEAR)->
setStartColor(new PHPPowerPoint_Style_Color('FFCCCCCC'))->setEndColor(new
PHPPowerPoint_Style_Color('FFFFFFFF'))->setRotation(270);
$shape->getBorder()->setLineStyle(PHPPowerPoint_Style_Border::LINE_SINGLE);
$shape->getTitle()->setText('# of people visiting your website');
$shape->getTitle()->getFont()->setItalic(true);
$shape->getPlotArea()->setType($lineChart);
$shape->getView3D()->setRotationX(30);
$shape->getView3D()->setPerspective(30);
$shape->getLegend()->getBorder()->setLineStyle(PHPPowerPoint_Style_Border::
LINE_SINGLE);
$shape->getLegend()->getFont()->setItalic(true);
// Save PowerPoint 2007 file
$objWriter = PHPPowerPoint_IOFactory::createWriter($objPHPPowerPoint,
'PowerPoint2007');
$objWriter->save(str_replace('.php', '.pptx', __file__));
function createTemplatedSlide(PHPPowerPoint $objPHPPowerPoint) {
// Create slide
$slide = $objPHPPowerPoint->createSlide();
// Return slide
return $slide;
}https://stackoverflow.com/questions/11632297
复制相似问题