Helper API refactor (#40)

* api cleaup

* updates

* wtf

* updates

* snapshot.

* tweaks

* snapshot

* api tweaks.

* updates

* updates

* updates

* changes.

* updates

* updates

* sequence => seq

* dont need to use curl, just using wget

* fixing examples
This commit is contained in:
Will Charczuk 2017-05-12 17:12:23 -07:00 committed by GitHub
parent 43212f871f
commit 03708a90ef
100 changed files with 1687 additions and 1055 deletions

10
tick.go
View file

@ -4,6 +4,8 @@ import (
"fmt"
"math"
"strings"
util "github.com/wcharczuk/go-chart/util"
)
// TicksProvider is a type that provides ticks.
@ -83,15 +85,15 @@ func GenerateContinuousTicks(r Renderer, ra Range, isVertical bool, style Style,
rangeDelta := math.Abs(max - min)
tickStep := rangeDelta / float64(intermediateTickCount)
roundTo := Math.GetRoundToForDelta(rangeDelta) / 10
intermediateTickCount = Math.MinInt(intermediateTickCount, 1<<10)
roundTo := util.Math.GetRoundToForDelta(rangeDelta) / 10
intermediateTickCount = util.Math.MinInt(intermediateTickCount, 1<<10)
for x := 1; x < intermediateTickCount; x++ {
var tickValue float64
if ra.IsDescending() {
tickValue = max - Math.RoundUp(tickStep*float64(x), roundTo)
tickValue = max - util.Math.RoundUp(tickStep*float64(x), roundTo)
} else {
tickValue = min + Math.RoundUp(tickStep*float64(x), roundTo)
tickValue = min + util.Math.RoundUp(tickStep*float64(x), roundTo)
}
ticks = append(ticks, Tick{
Value: tickValue,