Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A bug occurs when creating a line chart #765

Open
3883688 opened this issue Dec 1, 2023 · 0 comments
Open

A bug occurs when creating a line chart #765

3883688 opened this issue Dec 1, 2023 · 0 comments

Comments

@3883688
Copy link

3883688 commented Dec 1, 2023

When the first element of the inserted array is null, the generated PowerPoint opens blank in office 2016. I set setDisplayBlankAs to Chart::BLANKAS_GAP

$seriesData = [
'Monday 01' => null,
'Monday 03' => 5,
'Tuesday 02' => 3,
'Wednesday 03' => 1,
'Thursday 04' => 1,
'Friday 05' => 2,
'Saturday 06' => 34,
'Sunday 07' => 1,
];
// Create templated slide
echo EOL . date('H:i:s') . ' Create templated slide' . EOL;
$currentSlide = createTemplatedSlide($objPHPPresentation);

// Create a line chart (that should be inserted in a shape)
echo date('H:i:s') . ' Create a line chart (that should be inserted in a chart shape)' . EOL;
$lineChart = new Line();
$series = new Series('Downloads', $seriesData);
$series->setShowSeriesName(false);
$series->setShowValue(false);

$series->getMarker()->getBorder()->setColor(new Color('FFFF9045'));
$series->getMarker()->getFill()->setFillType(Fill::FILL_SOLID)->setStartColor(new Color('FFFFC6A0'));
$series->getMarker()->setSymbol(Marker::SYMBOL_CIRCLE);
$series->getMarker()->setSize(6);
$oOutline = new Outline();
// Create a shape (chart)
echo date('H:i:s') . ' Create a shape (chart)' . EOL;
$shape = $currentSlide->createChartShape();
$shape->setName('')->setResizeProportional(false)->setHeight(550)->setWidth(700)->setOffsetX(120)->setOffsetY(80);
$shape->setShadow($oShadow);
$shape->setFill($oFill);
$shape->setDisplayBlankAs(Chart::BLANKAS_GAP);
$shape->getBorder()->setLineStyle(Border::LINE_NONE);
$shape->getTitle()->setText('PHPPresentation Daily Downloads AAAAAA');
$shape->getTitle()->getFont()->setItalic(true);
$shape->getPlotArea()->setType($lineChart);
$shape->getView3D()->setRotationX(30);
$shape->getView3D()->setPerspective(30);
$shape->getLegend()->getBorder()->setLineStyle(Border::LINE_NONE);
$shape->getLegend()->getFont()->setItalic(true);
$shape->getPlotArea()->getAxisX()->setMajorUnit(1);
$shape->getPlotArea()->getAxisY()->setMajorUnit(1);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant