PHPOFFICE/PHPPRESETATION (PowerPoint) Wie man ein Diagramm (createChartShape) in eine Tabellenzelle einfügt?Php

PHP-Programmierer chatten hier
Anonymous
 PHPOFFICE/PHPPRESETATION (PowerPoint) Wie man ein Diagramm (createChartShape) in eine Tabellenzelle einfügt?

Post by Anonymous »

Wenn ich den Dokumenten folge

Code: Select all

$seriesData = array(
'Monday' => 12,
'Tuesday' => 15,
'Wednesday' => 13,
);
$series = new \PhpOffice\PhpPresentation\Shape\Chart\Series('Downloads', $seriesData);
$lineChart = new \PhpOffice\PhpPresentation\Shape\Chart\Type\Line();
$lineChart->addSeries($series);
$shape = $currentSlide->createChartShape(); // etc.
< /code>
Und dies funktioniert korrekt.$shape = $currentSlide->createTableShape();
$shape->setHeight(800);
// ..etc.
foreach ($datapoints as $datapoint) {
$row = $shape->createRow();
$row->setHeight(100);
$oCell = $row->nextCell();
$oCell->setWidth(240);
// This adds plain text in cell, it works:
$datapointValue = "Some text";
$oCell->createTextRun($datapointValue);
///////
// Instead the plain text I need to somehow add a chart here, with a loop:
// $datapointChart = $this->getMyChart($datapoint); // Chart should be encapsulated in a method like 'getMyChart'
// $oCell->createTextRun($datapointChart);
// .. but I have no idea what should 'getMyChart' return, and which method should I use instead the 'createTextRun' for the cell
///////
}
Grundsätzlich habe ich keine Ahnung, wie ich dies für eine Tabellenzelle verwenden soll (nicht direkt für die Folie):
$ shape = $ currentSlide-> createChartShape ();>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post