45
}
46
48
>
if len(points) == 0 {
50
>
}
51
53
>
for _, point := range points {
54
>
if point > maxPoint {
55
>
maxPoint = point
56
>
}
57
}
59
>
sb.Grow(len(points))
60
>
for _, point := range points {
61
>
if point == 0 {
62
>
sb.WriteRune(sparklineRunes[0])
63
>
continue
64
}
65
>
idx := int(math.Ceil(float64(point) / float64(maxPoint) * float64(len(sparklineRunes)-1)))
report.go
66
>
sb.WriteRune(sparklineRunes[idx])
67
}
69
}
70