diff options
author | xuri <xuri.me@gmail.com> | 2020-12-14 20:56:51 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2020-12-14 20:56:51 +0800 |
commit | 77978ac68d3808060e58df41ebede4b9f3631641 (patch) | |
tree | a707a5667effddbb3ea4679b6dd055ef7da98877 /drawing.go | |
parent | ad79505173302fdd7619288b793497052e25a148 (diff) |
This closes #657 and closes #748, AddChart support custom marker symbol and symbol size, fix AddPicture auto fit failure with multi merged cells
Diffstat (limited to 'drawing.go')
-rw-r--r-- | drawing.go | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -841,10 +841,17 @@ func (f *File) drawChartSeriesVal(v formatChartSeries, formatSet *formatChart) * // drawChartSeriesMarker provides a function to draw the c:marker element by // given data index and format sets. func (f *File) drawChartSeriesMarker(i int, formatSet *formatChart) *cMarker { + defaultSymbol := map[string]*attrValString{Scatter: &attrValString{Val: stringPtr("circle")}} marker := &cMarker{ - Symbol: &attrValString{Val: stringPtr("circle")}, + Symbol: defaultSymbol[formatSet.Type], Size: &attrValInt{Val: intPtr(5)}, } + if symbol := stringPtr(formatSet.Series[i].Marker.Symbol); *symbol != "" { + marker.Symbol = &attrValString{Val: symbol} + } + if size := intPtr(formatSet.Series[i].Marker.Size); *size != 0 { + marker.Size = &attrValInt{Val: size} + } if i < 6 { marker.SpPr = &cSpPr{ SolidFill: &aSolidFill{ @@ -862,7 +869,7 @@ func (f *File) drawChartSeriesMarker(i int, formatSet *formatChart) *cMarker { }, } } - chartSeriesMarker := map[string]*cMarker{Scatter: marker} + chartSeriesMarker := map[string]*cMarker{Scatter: marker, Line: marker} return chartSeriesMarker[formatSet.Type] } |