diff options
author | xuri <xuri.me@gmail.com> | 2022-10-14 00:48:16 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2022-10-14 00:48:16 +0800 |
commit | 3d02726ad4dc3bc6a92d5b68ef8421ac4db44076 (patch) | |
tree | b6fe49d32bf14f7b85316073037122d24b19adf0 /shape.go | |
parent | 7363c1e3337c5f0d9c70cc8af7504b3f8c092ab4 (diff) |
This closes #320, support custom chart axis font style
Diffstat (limited to 'shape.go')
-rw-r--r-- | shape.go | 28 |
1 files changed, 3 insertions, 25 deletions
@@ -323,27 +323,6 @@ func (f *File) addDrawingShape(sheet, drawingXML, cell string, opts *shapeOption colIdx := fromCol - 1 rowIdx := fromRow - 1 - textUnderlineType := map[string]bool{ - "none": true, - "words": true, - "sng": true, - "dbl": true, - "heavy": true, - "dotted": true, - "dottedHeavy": true, - "dash": true, - "dashHeavy": true, - "dashLong": true, - "dashLongHeavy": true, - "dotDash": true, - "dotDashHeavy": true, - "dotDotDash": true, - "dotDotDashHeavy": true, - "wavy": true, - "wavyHeavy": true, - "wavyDbl": true, - } - width := int(float64(opts.Width) * opts.Format.XScale) height := int(float64(opts.Height) * opts.Format.YScale) @@ -422,10 +401,9 @@ func (f *File) addDrawingShape(sheet, drawingXML, cell string, opts *shapeOption } } for _, p := range opts.Paragraph { - u := p.Font.Underline - _, ok := textUnderlineType[u] - if !ok { - u = "none" + u := "none" + if idx := inStrSlice(supportedDrawingUnderlineTypes, p.Font.Underline, true); idx != -1 { + u = supportedDrawingUnderlineTypes[idx] } text := p.Text if text == "" { |