summaryrefslogtreecommitdiff
path: root/chart.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2020-07-18 15:15:16 +0800
committerxuri <xuri.me@gmail.com>2020-07-18 15:15:16 +0800
commitc922c32fb7571d3d40d3244e5635142bc390a3db (patch)
tree12c2a1541458963caca5f7714d7861c42637d4c6 /chart.go
parent820a314cfbcaa4d32401b0b6c67bf65f064483ec (diff)
support parse and generate XML element namespace dynamic, fix #651
Diffstat (limited to 'chart.go')
-rw-r--r--chart.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/chart.go b/chart.go
index b584c18..ae31f71 100644
--- a/chart.go
+++ b/chart.go
@@ -755,6 +755,7 @@ func (f *File) AddChart(sheet, cell, format string, combo ...string) error {
f.addChart(formatSet, comboCharts)
f.addContentTypePart(chartID, "chart")
f.addContentTypePart(drawingID, "drawings")
+ f.addSheetNameSpace(sheet, SourceRelationship)
return err
}
@@ -804,7 +805,8 @@ func (f *File) AddChartSheet(sheet, format string, combo ...string) error {
// Update xl/workbook.xml
f.setWorkbook(sheet, sheetID, rID)
chartsheet, _ := xml.Marshal(cs)
- f.saveFileList(path, replaceRelationshipsBytes(replaceRelationshipsNameSpaceBytes(chartsheet)))
+ f.addSheetNameSpace(sheet, NameSpaceSpreadSheet)
+ f.saveFileList(path, replaceRelationshipsBytes(f.replaceNameSpaceBytes(path, chartsheet)))
return err
}