fix formatting

This commit is contained in:
Antoine de Troostembergh 2021-02-06 21:32:30 +01:00
parent 214df1a1cb
commit 1168789e8a
5 changed files with 33 additions and 22 deletions

View File

@ -250,8 +250,19 @@ See ``Sample_40_TemplateSetComplexValue.php`` for examples.
$table->addCell(150)->addText('Cell B3');
$templateProcessor->setComplexBlock('table', $table);
setChartValue
"""""""""""""
Replace a variable by a chart.
.. code-block:: php
$categories = array('A', 'B', 'C', 'D', 'E');
$series1 = array(1, 3, 2, 5, 4);
$chart = new Chart('doughnut', $categories, $series1);
$templateProcessor->setChartValue('myChart', $chart);
save
"""""""""
""""
Saves the loaded template within the current directory. Returns the file path.
.. code-block:: php
@ -259,7 +270,7 @@ Saves the loaded template within the current directory. Returns the file path.
$filepath = $templateProcessor->save();
saveAs
"""""""""
""""""
Saves a copy of the loaded template in the indicated path.
.. code-block:: php

View File

@ -270,7 +270,7 @@ class Chart extends AbstractPart
if (is_array($colors) && count($colors) > 0) {
// assign a color to each value
$valueIndex = 0;
foreach ($values as $value) {
for ($i = 1; $i < count($values); $i++) {
// check that there are still enought colors
$xmlWriter->startElement('c:dPt');
$xmlWriter->writeElementBlock('c:idx', 'val', $valueIndex);