diff options
author | xuri <xuri.me@gmail.com> | 2019-09-26 22:28:14 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2019-09-26 22:28:14 +0800 |
commit | eb520ae27757d4bca276fa2894bf461d75df9b37 (patch) | |
tree | 5fa25471b3b6590f5314445b49f909002b2962cb /shape.go | |
parent | 475fbf3856dd83c4813874570ae5ae2cb48ed421 (diff) |
Improve compatibility for charts
Diffstat (limited to 'shape.go')
-rw-r--r-- | shape.go | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -411,11 +411,6 @@ func (f *File) addDrawingShape(sheet, drawingXML, cell string, formatSet *format U: u, Sz: p.Font.Size * 100, Latin: &aLatin{Typeface: p.Font.Family}, - SolidFill: &aSolidFill{ - SrgbClr: &attrValString{ - Val: strings.Replace(strings.ToUpper(p.Font.Color), "#", "", -1), - }, - }, }, T: text, }, @@ -423,6 +418,14 @@ func (f *File) addDrawingShape(sheet, drawingXML, cell string, formatSet *format Lang: "en-US", }, } + srgbClr := strings.Replace(strings.ToUpper(p.Font.Color), "#", "", -1) + if len(srgbClr) == 6 { + paragraph.R.RPr.SolidFill = &aSolidFill{ + SrgbClr: &attrValString{ + Val: srgbClr, + }, + } + } shape.TxBody.P = append(shape.TxBody.P, paragraph) } twoCellAnchor.Sp = &shape |