I'm using the following code to create a chart with the PHP Powerpoint library.
$currentSlide = createTemplatedSlide($objPHPPowerPoint);
$seriesData = array('ABC'=>97,'BCD'=>97,'CDE'=>97,'DEF'=>97,'EFG'=>97,'FGH'=>97);
$lineChart = new PHPPowerPoint_Shape_Chart_Type_Line();
$series = new PHPPowerPoint_Shape_Chart_Series('Benchmark', $seriesData);
$series->setShowSeriesName(false);
$lineChart->addSeries($series);
$shape = $currentSlide->createChartShape();
$shape->setName('Benchmark')
->setResizeProportional(false)
->setHeight(480)
->setWidth(940)
->setOffsetX(10)
->setOffsetY(100);
$shape->getShadow()->setVisible(false)
$shape->getFill()->setFillType(PHPPowerPoint_Style_Fill::FILL_GRADIENT_LINEAR)
->setStartColor(new PHPPowerPoint_Style_Color('ddd9c3'))
->setEndColor(new PHPPowerPoint_Style_Color('ddd9c3'))
->setRotation(270);
$shape->getBorder()->setLineStyle(PHPPowerPoint_Style_Border::LINE_SINGLE);
$shape->getTitle()->setText('');
$shape->getTitle()->getFont()->setItalic(true);
$shape->getPlotArea()->setType($lineChart);
$shape->getView3D()->setRotationX(30);
$shape->getView3D()->setPerspective(30);
The chart is coming out as expected (screenshot attached), but I would like to customize 3 things:
- Add gridlines to the chart (Possible ?)
- Specify the chart line color instead of using the default ones. There are going to be multiple chart lines in a single chart. So I need to specify a custom color for each line.
- Label the Y-axis (At present it's blank)