inching up coverage.

This commit is contained in:
Will Charczuk 2016-07-10 23:06:14 -07:00
parent 18a6e3eed1
commit 56da554741
10 changed files with 315 additions and 92 deletions

12
tick.go
View file

@ -1,5 +1,17 @@
package chart
// GenerateTicksWithStep generates a set of ticks.
func GenerateTicksWithStep(ra Range, step float64, vf ValueFormatter) []Tick {
var ticks []Tick
for cursor := ra.Min; cursor < ra.Max; cursor += step {
ticks = append(ticks, Tick{
Value: cursor,
Label: vf(cursor),
})
}
return ticks
}
// Tick represents a label on an axis.
type Tick struct {
Value float64