From 007c7ec2b11d478188923d8664c43af1712bde4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20K=C3=A4llman?= Date: Thu, 7 Nov 2024 14:39:25 +0100 Subject: [PATCH] Fixes issue 1664 (#1665) * Fixes issue #1664 * Removed commented-out code --- src/EPPlus/Drawing/Chart/ExcelChartStandard.cs | 11 ++++------- src/EPPlusTest/Issues/ChartIssues.cs | 9 +++++++++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/EPPlus/Drawing/Chart/ExcelChartStandard.cs b/src/EPPlus/Drawing/Chart/ExcelChartStandard.cs index 478ac08e7..e1f61c00b 100644 --- a/src/EPPlus/Drawing/Chart/ExcelChartStandard.cs +++ b/src/EPPlus/Drawing/Chart/ExcelChartStandard.cs @@ -101,10 +101,9 @@ internal ExcelChartStandard(ExcelDrawings drawings, XmlNode node, Uri uriChart, Part = part; ChartXml = chartXml; _chartNode = chartNode; - InitSeries(this, drawings.NameSpaceManager, _chartNode, PivotTableSource != null); - InitChartLoad(drawings, chartNode); + InitChartLoad(drawings, chartNode, PivotTableSource != null); ChartType = GetChartType(chartNode.LocalName); - } + } internal ExcelChartStandard(ExcelChart topChart, XmlNode chartNode, ExcelGroupShape parent, string drawingPath = "xdr:graphicFrame", string nvPrPath = "xdr:nvGraphicFramePr/xdr:cNvPr") : base(topChart, chartNode, parent, drawingPath, nvPrPath) { @@ -113,12 +112,10 @@ internal ExcelChartStandard(ExcelChart topChart, XmlNode chartNode, ExcelGroupSh ChartXml = topChart.ChartXml; _plotArea = topChart.PlotArea; _chartNode = chartNode; - InitSeries(this, topChart._drawings.NameSpaceManager, _chartNode, false); - InitChartLoad(topChart._drawings, chartNode); + InitChartLoad(topChart._drawings, chartNode, false); } - private void InitChartLoad(ExcelDrawings drawings, XmlNode chartNode) + private void InitChartLoad(ExcelDrawings drawings, XmlNode chartNode, bool isPivot) { - bool isPivot = false; Init(drawings, chartNode); InitSeries(this, drawings.NameSpaceManager, _chartNode, isPivot); LoadAxis(); diff --git a/src/EPPlusTest/Issues/ChartIssues.cs b/src/EPPlusTest/Issues/ChartIssues.cs index b7a8bc8c0..c5e3dde69 100644 --- a/src/EPPlusTest/Issues/ChartIssues.cs +++ b/src/EPPlusTest/Issues/ChartIssues.cs @@ -359,5 +359,14 @@ public void s694_3() SaveAndCleanup(package); } } + [TestMethod] + public void s754() + { + using (var package = OpenTemplatePackage("s754.xlsx")) + { + var workbook = package.Workbook; + SaveAndCleanup(package); + } + } } }