From eb520ae27757d4bca276fa2894bf461d75df9b37 Mon Sep 17 00:00:00 2001 From: xuri Date: Thu, 26 Sep 2019 22:28:14 +0800 Subject: Improve compatibility for charts --- shape.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'shape.go') diff --git a/shape.go b/shape.go index e6a2ff3..f284e43 100644 --- a/shape.go +++ b/shape.go @@ -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 -- cgit v1.2.1