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"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// sparklineGroupPresets defined the list of sparkline group to create
|
// getSparklineGroupPresets returns the preset list of sparkline group to create
|
||||||
// x14:sparklineGroups element by given sparkline style ID.
|
// x14:sparklineGroups element.
|
||||||
var sparklineGroupPresets = []*xlsxX14SparklineGroup{
|
func getSparklineGroupPresets() []*xlsxX14SparklineGroup {
|
||||||
|
return []*xlsxX14SparklineGroup{
|
||||||
{
|
{
|
||||||
ColorSeries: &xlsxColor{Theme: intPtr(4), Tint: -0.499984740745262},
|
ColorSeries: &xlsxColor{Theme: intPtr(4), Tint: -0.499984740745262},
|
||||||
ColorNegative: &xlsxColor{Theme: intPtr(5)},
|
ColorNegative: &xlsxColor{Theme: intPtr(5)},
|
||||||
|
@ -355,6 +356,7 @@ var sparklineGroupPresets = []*xlsxX14SparklineGroup{
|
||||||
ColorLow: &xlsxColor{Theme: intPtr(7)},
|
ColorLow: &xlsxColor{Theme: intPtr(7)},
|
||||||
}, // 36
|
}, // 36
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// AddSparkline provides a function to add sparklines to the worksheet by
|
// AddSparkline provides a function to add sparklines to the worksheet by
|
||||||
// given formatting options. Sparklines are small charts that fit in a single
|
// 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
|
sparkType = specifiedSparkTypes
|
||||||
}
|
}
|
||||||
group = sparklineGroupPresets[opts.Style]
|
group = getSparklineGroupPresets()[opts.Style]
|
||||||
group.Type = sparkType
|
group.Type = sparkType
|
||||||
group.ColorAxis = &xlsxColor{RGB: "FF000000"}
|
group.ColorAxis = &xlsxColor{RGB: "FF000000"}
|
||||||
group.DisplayEmptyCellsAs = "gap"
|
group.DisplayEmptyCellsAs = "gap"
|
||||||
|
|
Loading…
Reference in New Issue