Hello,
You need to use the htmlentities function when you need to add a protected character such as & or <.
For example:
$data = array(
htmlentities('data &1') => array(20),
'data 2' => array(20),
'data 3' => array(50),
'data 4' => array(25),
'data 5' => array(5),
);
$paramsChart = array(
'data' => $data,
'type' => 'doughnutChart',
'showPercent' => true,
'explosion' => 10,
'holeSize' => 25,
'sizeX' => 12,
'sizeY' => 10,
'chartAlign' => 'center',
'color' => '2',
'legendPos' => 'r',
'legendOverlay' => true,
'showTable' => true,
);
$docx->addChart($paramsChart);
Regards.