From 200116c1939285136cd21de8306f62e81b7498df Mon Sep 17 00:00:00 2001 From: Will Charczuk Date: Sat, 30 Jul 2016 20:30:19 -0700 Subject: [PATCH] fixing sanity check test on gen ticks. --- tick.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tick.go b/tick.go index aedc2a7..dd1d161 100644 --- a/tick.go +++ b/tick.go @@ -55,13 +55,14 @@ func GenerateContinuousTicks(r Renderer, ra Range, isVertical bool, style Style, domainRemainder := (ra.GetDomain()) - (tickSize * 2) intermediateTickCount := int(math.Floor(float64(domainRemainder) / float64(tickSize))) - rangeDelta := math.Floor(max - min) + rangeDelta := max - min tickStep := rangeDelta / float64(intermediateTickCount) roundTo := Math.GetRoundToForDelta(rangeDelta) / 10 + intermediateTickCount = Math.MinInt(intermediateTickCount, 1<<10) for x := 1; x < intermediateTickCount; x++ { - tickValue := min + Math.RoundDown(tickStep*float64(x), roundTo) + tickValue := min + Math.RoundUp(tickStep*float64(x), roundTo) ticks = append(ticks, Tick{ Value: tickValue, Label: vf(tickValue),