PHPPresentation - 折线图阴影

时间:2016-08-05 09:47:09

标签: php laravel phppresentation

我想要阴影线图,阴影线区域的方法是什么。 我使用过这段代码

     $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);

是否有适用于Series类或Line类的方法,有助于填充阴影颜色。 请让我知道如何为折线图区域划线

我想要以下类型的图表

enter image description here

1 个答案:

答案 0 :(得分:0)

请浏览此链接

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

希望这能解决您的问题。