inching up coverage.
This commit is contained in:
parent
18a6e3eed1
commit
56da554741
10 changed files with 315 additions and 92 deletions
12
tick.go
12
tick.go
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue