问题
I can't make radar chart with PHPExcel. I need to add to DataSeriesValues range of separate cells
$xAxisTickValues = [
new \PHPExcel_Chart_DataSeriesValues('String', $sn.'!$B$5', NULL, 1),
new \PHPExcel_Chart_DataSeriesValues('String', $sn.'!$B$10', NULL, 1),
new \PHPExcel_Chart_DataSeriesValues('String', $sn.'!$B$14', NULL, 1),
new \PHPExcel_Chart_DataSeriesValues('String', $sn.'!$B$17', NULL, 1),
]; //This works fine
$xAxisTickValues = [
new \PHPExcel_Chart_DataSeriesValues('String', $sn.'!$B$5:$B$10', NULL, 1),
];//This works too
I need something like this:
$xAxisTickValues = [
new \PHPExcel_Chart_DataSeriesValues('String', $sn.'!$B$5;'.$sn.'!$A$15', NULL, 1),
]; //but this won't work
回答1:
I've not tried it myself; but have you tried using a ,
separator for the ranges rather than a ;
? PHPExcel expects US/UK "syntax", and the separator for cell ranges in US/UK is the ,
$xAxisTickValues = [
new \PHPExcel_Chart_DataSeriesValues('String', $sn.'!$B$5,'.$sn.'!$A$15', NULL, 1),
];
来源:https://stackoverflow.com/questions/44971116/how-to-set-range-of-separate-cells-in-dataseriesvalues-phpexcel-radarchart