diff --git a/src/PhpSpreadsheet/Writer/Xlsx/Chart.php b/src/PhpSpreadsheet/Writer/Xlsx/Chart.php index 583b262c35..23a5a54473 100644 --- a/src/PhpSpreadsheet/Writer/Xlsx/Chart.php +++ b/src/PhpSpreadsheet/Writer/Xlsx/Chart.php @@ -1083,7 +1083,7 @@ private function writePlotGroup($plotGroup, $groupType, $objWriter, &$catIsMulti $objWriter->startElement('c:ser'); $plotLabel = $plotGroup->getPlotLabelByIndex($plotSeriesIdx); - if ($plotLabel) { + if ($plotLabel && $groupType !== DataSeries::TYPE_LINECHART) { $fillColor = $plotLabel->getFillColor(); if ($fillColor !== null && !is_array($fillColor)) { $objWriter->startElement('c:spPr'); @@ -1141,6 +1141,13 @@ private function writePlotGroup($plotGroup, $groupType, $objWriter, &$catIsMulti if ($groupType == DataSeries::TYPE_STOCKCHART) { $objWriter->startElement('a:noFill'); $objWriter->endElement(); + } elseif ($plotLabel && $plotLabel->getFillColor() !== null) { + $fillColor = $plotLabel->getFillColor(); + $objWriter->startElement('a:solidFill'); + $objWriter->startElement('a:srgbClr'); + $objWriter->writeAttribute('val', $fillColor); + $objWriter->endElement(); + $objWriter->endElement(); } $objWriter->endElement(); $objWriter->endElement();