From a97800bdaf067f76a9eedad55a441fa25d8bb3dc Mon Sep 17 00:00:00 2001 From: Tiago Malheiro Date: Sun, 31 Oct 2021 10:16:18 +0000 Subject: [PATCH] Handle case where Line chart getFillColor() is an array --- src/PhpSpreadsheet/Writer/Xlsx/Chart.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/PhpSpreadsheet/Writer/Xlsx/Chart.php b/src/PhpSpreadsheet/Writer/Xlsx/Chart.php index c33169ab58..efbbb6c87c 100644 --- a/src/PhpSpreadsheet/Writer/Xlsx/Chart.php +++ b/src/PhpSpreadsheet/Writer/Xlsx/Chart.php @@ -1144,13 +1144,15 @@ private function writePlotGroup($plotGroup, $groupType, $objWriter, &$catIsMulti if ($groupType == DataSeries::TYPE_STOCKCHART) { $objWriter->startElement('a:noFill'); $objWriter->endElement(); - } elseif ($plotLabel && $plotLabel->getFillColor() !== null) { + } elseif ($plotLabel) { $fillColor = $plotLabel->getFillColor(); - $objWriter->startElement('a:solidFill'); - $objWriter->startElement('a:srgbClr'); - $objWriter->writeAttribute('val', $fillColor); - $objWriter->endElement(); - $objWriter->endElement(); + if ($fillColor !== null && !is_array($fillColor)) { + $objWriter->startElement('a:solidFill'); + $objWriter->startElement('a:srgbClr'); + $objWriter->writeAttribute('val', $fillColor); + $objWriter->endElement(); + $objWriter->endElement(); + } } $objWriter->endElement(); $objWriter->endElement();