Код: Выделить всё
$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>
И это работает правильно.$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
///////
}
$ shape = $ currentslide-> createChartShape ();
И если я инкаую в диаграмме в методе PHP: что должно быть мимо метод (который должен пройти (что должно быть прописано (что должно быть прописано (что должно быть прописано в сото).>
Подробнее здесь: https://stackoverflow.com/questions/731 ... tshape-ins
Мобильная версия