donglanying3855 2013-09-27 07:59
浏览 55
已采纳

隐藏PHPExcel图表中的图例

I have started using PHPExcel 1.7.9 for creating different types of charts. I want to hide Legend. I have tried many possible solutions but coudn't be able to find the exact way. First I tried to empty the first parameter of PHPExcel_Chart_Legend like this

$legend = new PHPExcel_Chart_Legend('', NULL, false);

It started to show my Legend at right side in vertical position. Then I tried to empty the Legend parameter of PHPExcel_Chart but it generated an error like follow

  // Create the chart
    $chart = new PHPExcel_Chart(
                    'chart1', // name
                    $title, // title
                    '', // legend
                    $plotarea, // plotArea
                    true, // plotVisibleOnly
                    0, // displayBlanksAs
                    $xAxisLabel, // xAxisLabel
                    $yAxisLabel // yAxisLabel
    );

I have tried to search it out but still not succeeded. Please advice a way so that I can hide legends in my charts.

Best Regards

  • 写回答

1条回答 默认 最新

  • dongtan7351 2013-09-28 11:19
    关注

    To suppress the legend, simply set it to NULL

    // Create the chart
    $chart = new PHPExcel_Chart(
        'chart1',      // name
        $title,        // title
        NULL,          // legend
        $plotarea,     // plotArea
        true,          // plotVisibleOnly
        0,             // displayBlanksAs
        $xAxisLabel,   // xAxisLabel
        $yAxisLabel    // yAxisLabel
    );
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类