This project is read-only.

PHPPowerPoint Shows Blank Graph That's Not on the Slide

Mar 7, 2014 at 1:43 PM
As I could find no documentation for this product, I re-worked a sample I found here. Unfortunately, it's not working. What am I doing wrong?

Here's the code. I do have a header-redirect after-wards to ensure the download, so that's not the issue:
// Create new PHPPowerPoint object
$objPHPPowerPoint = new PHPPowerPoint();

$objPHPPowerPoint->removeSlideByIndex(0);
$currentSlide = $objPHPPowerPoint->createSlide();

// Create a bar chart (that should be inserted in a shape)
$series = new PHPPowerPoint_Shape_Chart_Series('', array(
    'A' => 69,
    'B' => 5,
    'C' => 5,
    'D' => 3,
    'E' => 2
));
$series->setShowSeriesName(true);
$bar3DChart = new PHPPowerPoint_Shape_Chart_Type_Bar3D();   
$bar3DChart->addSeries($series);

// Create a shape (chart)
$shape = $currentSlide->createChartShape();

$shape->setResizeProportional(false);
$shape->setOffsetX(0);
$shape->setOffsetY(0);
$shape->setHeight(550);
$shape->setWidth(800);

$shape->getTitle()->setText($matrix[0][$graphCol]);
$shape->getPlotArea()->setType($bar3DChart);

// Save PowerPoint 2007 file
$objWriter = PHPPowerPoint_IOFactory::createWriter($objPHPPowerPoint,'PowerPoint2007');
$objWriter->save('php://output');