1

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 Answers1

0

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),
];
Mark Baker
  • 209,507
  • 32
  • 346
  • 385
  • thank you for your answer, but i've tried different separators, and this did not help. – Роман Ямчук Jul 10 '17 at 08:40
  • Im dealing with the same thing, and this did not work for me.PLEASE can you have a look at my question @Mark Barker -> https://stackoverflow.com/questions/62083470/php-excel-cant-render-proper-xaxis-range-in-charts – morne May 29 '20 at 11:19