I use Advanced Version of phpdocx 6.5.
I have sam problem with layouting charts.
1) I'm adding a 2D column chart to my document but the axis labels always seem to overlay on top of the values display along on the X and Y axis.
2) Inspite of I set parametr 'legendpos' => 'none' the legend on the chart stiil is displayed
What I'm doing wrong?
Sample code:
$docx = new CreateDocxFromTemplate ( 'template.docx' );
$data = array(
'legend' => array(''),
'January' => array(10),
'February' => array(17),
'March' => array(25),
'April' => array(9)
);
$paramsChart = array (
'data' => $data,
'type' => 'colChart',
'title' => 'Sales',
'color' => 2,
'sizeX' => 10,
'sizeY' => 6,
'font' => 'Times New Roman',
'legendpos' => 'none',
'border' => 'none',
'haxLabel' => 'Months',
'haxLabelDisplay' => 'horizontal',
'vaxLabel' => 'Sales [$]',
'vaxLabelDisplay' => 'rotated',
'hgrid' => 1,
'vgrid' => 0,
'chartAlign' => 'center',
'showCategory' => false
);
$chart = new WordFragment ( $docx, 'document' );
$chart->addChart ( $paramsChart );
$variables = array (
'CHART1' => $chart
);
$docx->replaceVariableByWordFragment ( $variables, array (
'type' => 'inline'
) );
$docx->addText('And now the same chart addChartMethod on $docx');
$docx->addChart($paramsChart);