This commit is contained in:
Will Charczuk 2016-07-11 18:48:51 -07:00
parent 01983f4e86
commit 9a5138b21d
17 changed files with 477 additions and 308 deletions

View file

@ -3,7 +3,8 @@ 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 {
min, max := ra.GetRoundedRangeBounds()
for cursor := min; cursor <= max; cursor += step {
ticks = append(ticks, Tick{
Value: cursor,
Label: vf(cursor),