can just supply inverted ranges.

This commit is contained in:
Will Charczuk 2017-01-09 17:57:45 -08:00
parent 21986dbce7
commit 78cbfa62bc
7 changed files with 66 additions and 29 deletions

View file

@ -1,9 +1,6 @@
package chart
import (
"math"
"sort"
)
import "math"
// XAxis represents the horizontal axis.
type XAxis struct {
@ -71,7 +68,6 @@ func (xa XAxis) GetGridLines(ticks []Tick) []GridLine {
// Measure returns the bounds of the axis.
func (xa XAxis) Measure(r Renderer, canvasBox Box, ra Range, defaults Style, ticks []Tick) Box {
tickStyle := xa.TickStyle.InheritFrom(xa.Style.InheritFrom(defaults))
sort.Sort(Ticks(ticks))
tp := xa.GetTickPosition()
@ -124,8 +120,6 @@ func (xa XAxis) Render(r Renderer, canvasBox Box, ra Range, defaults Style, tick
r.LineTo(canvasBox.Right, canvasBox.Bottom)
r.Stroke()
sort.Sort(Ticks(ticks))
tp := xa.GetTickPosition()
var tx, ty int