Skip to content

Commit f369340

Browse files
authored
getDataLabel defends against empty labels
1 parent ccee869 commit f369340

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/PhpSpreadsheet/Chart/Renderer/JpGraphRendererBase.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,8 @@ private function getDataLabel(int $groupId, int $index): mixed
286286
$plotLabel = $this->chart->getPlotArea()->getPlotGroupByIndex($groupId)->getPlotLabelByIndex($index);
287287
if (!$plotLabel) {
288288
return '';
289-
} else {
290-
return $plotLabel->getDataValue();
291289
}
290+
return $plotLabel->getDataValue();
292291
}
293292

294293
private function renderPlotLine(int $groupID, bool $filled = false, bool $combination = false): void

0 commit comments

Comments
 (0)