如何在 DataSeriesValues PHPExcel RadarChart 中设置单独单元格的范围 [英] How to set range of separate cells in DataSeriesValues PHPExcel RadarChart

查看:83
本文介绍了如何在 DataSeriesValues PHPExcel RadarChart 中设置单独单元格的范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法使用 PHPExcel 制作雷达图.我需要添加到单独单元格的 DataSeriesValues 范围

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

我需要这样的东西:

    $xAxisTickValues = [
        new \PHPExcel_Chart_DataSeriesValues('String', $sn.'!$B$5;'.$sn.'!$A$15', NULL, 1),
    ]; //but this won't work

推荐答案

我自己没试过;但是您是否尝试过对范围使用 , 分隔符而不是 ; ?PHPExcel 需要美国/英国语法",美国/英国单元格范围的分隔符是 ,

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),
];

这篇关于如何在 DataSeriesValues PHPExcel RadarChart 中设置单独单元格的范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆