I have a problem with the library PHPExcel (1.7.7): When I want to create a piechart, labels and legends are not displayed. However, with other graphics, I do not have that problem. Do you have any a solution?
Thanks.
Here is the code used:
$categories = array(
new PHPExcel_Chart_DataSeriesValues('String', 'RECAPITULATIF!$B$6:$B$8', null, 3),
);
$values = array(
new PHPExcel_Chart_DataSeriesValues('Number', 'RECAPITULATIF!$F$6:$F$8', null, 3),
);
$series = new PHPExcel_Chart_DataSeries(
PHPExcel_Chart_DataSeries::TYPE_PIECHART, // plotType
PHPExcel_Chart_DataSeries::GROUPING_CLUSTERED, // plotGrouping
array(0), // plotOrder
null, // plotLabel
$categories, // plotCategory
$values // plotValues
);
$plotarea = new PHPExcel_Chart_PlotArea(null, array($series));
$title = new PHPExcel_Chart_Title('Pie chart');
$legend = new PHPExcel_Chart_Legend(PHPExcel_Chart_Legend::POSITION_RIGHT, null, false);
$chart = new PHPExcel_Chart(
'chart2', // name
$title, // title
$legend, // legend
$plotarea, // plotArea
true, // plotVisibleOnly
0, // displayBlanksAs
null, // xAxisLabel
null // yAxisLabel
);