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)},
|
||||
|
@ -355,6 +356,7 @@ var sparklineGroupPresets = []*xlsxX14SparklineGroup{
|
|||
ColorLow: &xlsxColor{Theme: intPtr(7)},
|
||||
}, // 36
|
||||
}
|
||||
}
|
||||
|
||||
// AddSparkline provides a function to add sparklines to the worksheet by
|
||||
// given formatting options. Sparklines are small charts that fit in a single
|
||||
|
@ -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