mardi 21 novembre 2017

Powerpoint charts needs repair

i'm currently working on a project where I need to create powerpoints online. I'm using http://ift.tt/1RIak9x for this. Almost everything works perfectly, besides generating charts. When I open the powerpoint, it says it needs repairing. After the repair all the content is lost.

I wondered if anybody else had the same problem and could help me solve this problem.

Code i tried:

    $oPHPPresentation = new PhpPresentation();
    $currentSlide = $oPHPPresentation->createSlide();
    $currentSlide->setName('Title of the slide');
    $lineChart = new Line();


    $seriesData = array('Monday' => 18, 'Tuesday' => 23, 'Wednesday' => 14, 'Thursday' => 12, 'Friday' => 20, 'Saturday' => 8, 'Sunday' => 10);
    $series = new Series('example', $seriesData);
    $series->setShowValue(false);
    $series->setShowPercentage(true); // This does nothing
    $series->setDlblNumFormat('0.00%'); // This does nothing

    $lineChart->addSeries($series);
    $shape = $currentSlide->createChartShape();
    $shape->getPlotArea()->setType($lineChart);

    $oWriterPPTX = IOFactory::createWriter($oPHPPresentation, 'PowerPoint2007');
    $oWriterPPTX->save(__DIR__ . "/sample.pptx");

Package: http://ift.tt/1RIak9x
framework: Laravel 5.1
php version: 7.0

Thanks in advance



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire