summaryrefslogtreecommitdiff
path: root/picture.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2020-03-28 23:47:26 +0800
committerxuri <xuri.me@gmail.com>2020-03-28 23:47:26 +0800
commit6afc468a025984aa1b265b0228f032c5ed881a3b (patch)
tree6b51e97cbf9c5fc151bb14766c720731ec3bc2ad /picture.go
parenta75c6f63bea6c8e438482cb79e1725f23d7f7f9c (diff)
Resolve #451, support create chart sheet
Diffstat (limited to 'picture.go')
-rw-r--r--picture.go16
1 files changed, 9 insertions, 7 deletions
diff --git a/picture.go b/picture.go
index 3e24ce3..ddc0480 100644
--- a/picture.go
+++ b/picture.go
@@ -354,7 +354,7 @@ func (f *File) setContentTypePartVMLExtensions() {
if !vml {
content.Defaults = append(content.Defaults, xlsxDefault{
Extension: "vml",
- ContentType: "application/vnd.openxmlformats-officedocument.vmlDrawing",
+ ContentType: ContentTypeVML,
})
}
}
@@ -368,6 +368,7 @@ func (f *File) addContentTypePart(index int, contentType string) {
}
partNames := map[string]string{
"chart": "/xl/charts/chart" + strconv.Itoa(index) + ".xml",
+ "chartsheet": "/xl/chartsheets/sheet" + strconv.Itoa(index) + ".xml",
"comments": "/xl/comments" + strconv.Itoa(index) + ".xml",
"drawings": "/xl/drawings/drawing" + strconv.Itoa(index) + ".xml",
"table": "/xl/tables/table" + strconv.Itoa(index) + ".xml",
@@ -375,12 +376,13 @@ func (f *File) addContentTypePart(index int, contentType string) {
"pivotCache": "/xl/pivotCache/pivotCacheDefinition" + strconv.Itoa(index) + ".xml",
}
contentTypes := map[string]string{
- "chart": "application/vnd.openxmlformats-officedocument.drawingml.chart+xml",
- "comments": "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",
- "drawings": "application/vnd.openxmlformats-officedocument.drawing+xml",
- "table": "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",
- "pivotTable": "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml",
- "pivotCache": "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml",
+ "chart": ContentTypeDrawingML,
+ "chartsheet": ContentTypeSpreadSheetMLChartsheet,
+ "comments": ContentTypeSpreadSheetMLComments,
+ "drawings": ContentTypeDrawing,
+ "table": ContentTypeSpreadSheetMLTable,
+ "pivotTable": ContentTypeSpreadSheetMLPivotTable,
+ "pivotCache": ContentTypeSpreadSheetMLPivotCacheDefinition,
}
s, ok := setContentType[contentType]
if ok {