test: add test for charts
This commit is contained in:
parent
a6b92f1d47
commit
212a51083f
11 changed files with 963 additions and 16 deletions
|
|
@ -201,17 +201,7 @@ func ChildOptionFunc(child ...ChartOption) OptionFunc {
|
|||
// RadarIndicatorOptionFunc set radar indicator of chart
|
||||
func RadarIndicatorOptionFunc(names []string, values []float64) OptionFunc {
|
||||
return func(opt *ChartOption) {
|
||||
if len(names) != len(values) {
|
||||
return
|
||||
}
|
||||
indicators := make([]RadarIndicator, len(names))
|
||||
for index, name := range names {
|
||||
indicators[index] = RadarIndicator{
|
||||
Name: name,
|
||||
Max: values[index],
|
||||
}
|
||||
}
|
||||
opt.RadarIndicators = indicators
|
||||
opt.RadarIndicators = NewRadarIndicators(names, values)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue