summaryrefslogtreecommitdiff
path: root/drawing.go
diff options
context:
space:
mode:
Diffstat (limited to 'drawing.go')
-rw-r--r--drawing.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/drawing.go b/drawing.go
index 59b6d2a..e05c9be 100644
--- a/drawing.go
+++ b/drawing.go
@@ -768,6 +768,16 @@ func (f *File) drawChartSeries(formatSet *formatChart) *[]cSer {
// drawChartSeriesSpPr provides a function to draw the c:spPr element by given
// format sets.
func (f *File) drawChartSeriesSpPr(i int, formatSet *formatChart) *cSpPr {
+ var srgbClr *attrValString
+ var schemeClr *aSchemeClr
+
+ if color := stringPtr(formatSet.Series[i].Line.Color); *color != "" {
+ *color = strings.TrimPrefix(*color, "#")
+ srgbClr = &attrValString{Val: color}
+ } else {
+ schemeClr = &aSchemeClr{Val: "accent" + strconv.Itoa((formatSet.order+i)%6+1)}
+ }
+
spPrScatter := &cSpPr{
Ln: &aLn{
W: 25400,
@@ -779,7 +789,8 @@ func (f *File) drawChartSeriesSpPr(i int, formatSet *formatChart) *cSpPr {
W: f.ptToEMUs(formatSet.Series[i].Line.Width),
Cap: "rnd", // rnd, sq, flat
SolidFill: &aSolidFill{
- SchemeClr: &aSchemeClr{Val: "accent" + strconv.Itoa((formatSet.order+i)%6+1)},
+ SchemeClr: schemeClr,
+ SrgbClr: srgbClr,
},
},
}