dongyuan9149 2016-08-05 09:47
浏览 70
已采纳

PHPPresentation - 折线图阴影

I want shaded line chart what would be the method to shade line area. I have used this code

     $seriesData = array(
        'Monday' => 12,
        'Tuesday' => 15,
        'Wednesday' => 13,
        'Thursday' => 17,
        'Friday' => 14,
        'Saturday' => 9,
        'Sunday' => 7
    );

    $seriesData1 = array(
        'Monday' => 22,
        'Tuesday' => 25,
        'Wednesday' => 23,
        'Thursday' => 27,
        'Friday' => 24,
        'Saturday' => 19,
        'Sunday' => 17
    );

    $oFill = new Fill();
    $oFill->setFillType(Fill::FILL_SOLID)->setStartColor(new Color('FFE06B99'));
    $oShadow = new Shadow();
    $oShadow->setVisible(true)->setDirection(45)->setDistance(10);

    $lineChart = new Line();
    $series = new Series('Downloads', $seriesData);
    $series->setShowSeriesName(true);
    $series->setShowValue(true);
    $series->setFill(new Fill(new Color('FFE06B99')));
    $lineChart->addSeries($series);

    $series1 = new Series('Downloads', $seriesData1);
    $series1->setShowSeriesName(true);
    $series1->setShowValue(true);
    $lineChart->addSeries($series1);

    $shape = $currentSlide->createChartShape();
    $shape->setName('PHPPresentation Daily Downloads')->setResizeProportional(false)->setHeight(550)->setWidth(700)->setOffsetX(120)->setOffsetY(80);
    $shape->getBorder()->setLineStyle(Border::LINE_SINGLE);
    $shape->getTitle()->setText('PHPPresentation Daily Downloads');
    $shape->getTitle()->getFont()->setItalic(true);
    $shape->getPlotArea()->setType($lineChart);
    $shape->getView3D()->setRotationX(30);
    $shape->getView3D()->setPerspective(30);
    $shape->getLegend()->getBorder()->setLineStyle(Border::LINE_SINGLE);
    $shape->getLegend()->getFont()->setItalic(true);

Is there any method for Series class or for Line class which helps to fill shade color. Please let me know how to shade the area for line chart

I want following type of chart

enter image description here

  • 写回答

1条回答 默认 最新

  • dongyutan1703 2016-08-09 07:39
    关注

    Please go through this link

    How do I customize the line in a line chart with PHPPowerpoint/PHPPresentation?

    Hope this solves your issue.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Matlab问题解答有两个问题
  • ¥50 Oracle Kubernetes服务器集群主节点无法访问,工作节点可以访问
  • ¥15 LCD12864中文显示
  • ¥15 在使用CH341SER.EXE时不小心把所有驱动文件删除了怎么解决
  • ¥15 gsoap生成onvif框架
  • ¥15 有关sql server business intellige安装,包括SSDT、SSMS。
  • ¥15 stm32的can接口不能收发数据
  • ¥15 目标检测算法移植到arm开发板
  • ¥15 利用JD51设计温度报警系统
  • ¥15 快手联盟怎么快速的跑出建立模型