How to set range of separate cells in DataSeriesValues PHPExcel RadarChart

北城以北 提交于 2021-02-10 16:24:29

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!