This closes #1910, fix a v2.8.1 regression bug introduced by commit 866f3086cd
- Fix spark lines duplicate when creating spark lines on multiple sheets
This commit is contained in:
parent
08d25006f9
commit
c349313850
10
sparkline.go
10
sparkline.go
|
@ -18,9 +18,10 @@ import (
|
|||
"strings"
|
||||
)
|
||||
|
||||
// sparklineGroupPresets defined the list of sparkline group to create
|
||||
// x14:sparklineGroups element by given sparkline style ID.
|
||||
var sparklineGroupPresets = []*xlsxX14SparklineGroup{
|
||||
// getSparklineGroupPresets returns the preset list of sparkline group to create
|
||||
// x14:sparklineGroups element.
|
||||
func getSparklineGroupPresets() []*xlsxX14SparklineGroup {
|
||||
return []*xlsxX14SparklineGroup{
|
||||
{
|
||||
ColorSeries: &xlsxColor{Theme: intPtr(4), Tint: -0.499984740745262},
|
||||
ColorNegative: &xlsxColor{Theme: intPtr(5)},
|
||||
|
@ -354,6 +355,7 @@ var sparklineGroupPresets = []*xlsxX14SparklineGroup{
|
|||
ColorHigh: &xlsxColor{Theme: intPtr(6)},
|
||||
ColorLow: &xlsxColor{Theme: intPtr(7)},
|
||||
}, // 36
|
||||
}
|
||||
}
|
||||
|
||||
// AddSparkline provides a function to add sparklines to the worksheet by
|
||||
|
@ -412,7 +414,7 @@ func (f *File) AddSparkline(sheet string, opts *SparklineOptions) error {
|
|||
}
|
||||
sparkType = specifiedSparkTypes
|
||||
}
|
||||
group = sparklineGroupPresets[opts.Style]
|
||||
group = getSparklineGroupPresets()[opts.Style]
|
||||
group.Type = sparkType
|
||||
group.ColorAxis = &xlsxColor{RGB: "FF000000"}
|
||||
group.DisplayEmptyCellsAs = "gap"
|
||||
|
|
Loading…
Reference in New Issue