test: add test for charts

This commit is contained in:
vicanso 2022-06-20 23:23:21 +08:00
parent a6b92f1d47
commit 212a51083f
11 changed files with 963 additions and 16 deletions

View file

@ -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)
}
}