I have been reading through the documentation and I have managed to create a Horizontal bar chart but I am currently struggling to create a vertical bar chart. Please could someone point me into the right direction?
$data = array(
'legend' => array('Legend 1', 'Legend 2', 'Legend 3'),
'data' => array(
array(
'name' => 'data 1',
'values' => array(10, 20, 5),
),
array(
'name' => 'data 2',
'values' => array(20, 60, 3),
),
array(
'name' => 'data 3',
'values' => array(50, 33, 7),
),
),
);
$paramsChart = array(
'data' => $data,
'type' => 'barChart',
'color' => '3',
'perspective' => '10',
'rotX' => '10',
'rotY' => '10',
'chartAlign' => 'center',
'sizeX' => '10',
'sizeY' => '10',
'legendPos' => 'b',
'legendOverlay' => '0',
'border' => '1',
'hgrid' => '3',
'vgrid' => '0',
'groupBar' => 'stacked',
'barDirection' => 'col' // Set barDirection to 'col' for vertical bars
);
$docx->addChart($paramsChart);
$chart = new WordFragment($docx, 'document');
$chart->addChart($paramsChart);
$docx->replaceVariableByWordFragment(array('CHART' => $chart), array('type' => 'block'));