Skip to content

Commit 3b37d3e

Browse files
authored
getDataLabel() defends against empty labels
1 parent 766a73c commit 3b37d3e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/PhpSpreadsheet/Chart/Renderer/JpGraphRendererBase.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ private function getDataLabel(int $groupId, int $index): mixed
287287
if (!$plotLabel) {
288288
return '';
289289
}
290-
290+
291291
return $plotLabel->getDataValue();
292292
}
293293

@@ -757,7 +757,7 @@ private function renderCombinationChart($groupCount, $outputDestination): bool
757757
break;
758758
case 'bar3DChart':
759759
$dimensions = '3d';
760-
// no break
760+
// no break
761761
case 'barChart':
762762
$this->renderPlotBar($i, $dimensions);
763763

@@ -818,35 +818,35 @@ public function render(?string $outputDestination): bool
818818
switch ($chartType) {
819819
case 'area3DChart':
820820
$dimensions = '3d';
821-
// no break
821+
// no break
822822
case 'areaChart':
823823
$this->renderAreaChart($groupCount);
824824

825825
break;
826826
case 'bar3DChart':
827827
$dimensions = '3d';
828-
// no break
828+
// no break
829829
case 'barChart':
830830
$this->renderBarChart($groupCount, $dimensions);
831831

832832
break;
833833
case 'line3DChart':
834834
$dimensions = '3d';
835-
// no break
835+
// no break
836836
case 'lineChart':
837837
$this->renderLineChart($groupCount);
838838

839839
break;
840840
case 'pie3DChart':
841841
$dimensions = '3d';
842-
// no break
842+
// no break
843843
case 'pieChart':
844844
$this->renderPieChart($groupCount, $dimensions, false, false);
845845

846846
break;
847847
case 'doughnut3DChart':
848848
$dimensions = '3d';
849-
// no break
849+
// no break
850850
case 'doughnutChart':
851851
$this->renderPieChart($groupCount, $dimensions, true, true);
852852

0 commit comments

Comments
 (0)