diff --git a/src/Sheet.php b/src/Sheet.php index fdc59b46..26d0b8f2 100644 --- a/src/Sheet.php +++ b/src/Sheet.php @@ -189,10 +189,6 @@ public function open($sheetExport) $this->hasStrictNullComparison($sheetExport) ); } - - if ($sheetExport instanceof WithCharts) { - $this->addCharts($sheetExport->charts()); - } } /** @@ -396,6 +392,10 @@ public function toCollection($import, int $startRow = null, $nullValue = null, $ */ public function close($sheetExport) { + if ($sheetExport instanceof WithCharts) { + $this->addCharts($sheetExport->charts()); + } + if ($sheetExport instanceof WithDrawings) { $this->addDrawings($sheetExport->drawings()); }