This method allows for the insertion of dynamical charts and graphs in your Word document. One may choose different types of graphs: pie charts, bar charts, etcetera in 2D or 3D (only PRO version).
$paramsChart
require_once 'classes/CreateDocx.inc';
$docx = new CreateDocx();
$legends = array(
'legend1' => array(10, 11, 12),
'legend2' => array(0, 1, 2),
'legend3' => array(40, 41, 42)
);
$paramsChart = array(
'data' => $legends,
'type' => 'pieChart',
'title' => 'Title',
'cornerX' => 20,
'cornerY' => 20,
'cornerP' => 30,
'color' => 2,
'textWrap' => 0,
'sizeX' => 10,
'sizeY' => 10,
'jc' => 'right',
'showPercent' => 1,
'font' => 'Times New Roman'
);
$docx->addGraphic($paramsChart);
$docx->createDocx('example_chart');

require_once 'classes/CreateDocx.inc';
$docx = new CreateDocx();
$legends = array(
'legend1' => array(10, 11, 12),
'legend2' => array(0, 1, 2),
'legend3' => array(40, 41, 42)
);
$paramsChart = array(
'data' => $legends,
'type' => 'pie3DChart',
'title' => 'Title',
'cornerX' => 20,
'cornerY' => 20,
'cornerP' => 30,
'color' => 2,
'textWrap' => 0,
'sizeX' => 10,
'sizeY' => 10,
'jc' => 'right',
'showPercent' => 1,
'font' => 'Times New Roman'
);
$docx->addGraphic($paramsChart);
$docx->createDocx('example_chart');
One Response
Please commit some barchart stacked examples!
Thanks a lot!!!