can just supply inverted ranges.
This commit is contained in:
parent
21986dbce7
commit
78cbfa62bc
7 changed files with 66 additions and 29 deletions
12
yaxis.go
12
yaxis.go
|
|
@ -1,9 +1,6 @@
|
|||
package chart
|
||||
|
||||
import (
|
||||
"math"
|
||||
"sort"
|
||||
)
|
||||
import "math"
|
||||
|
||||
// YAxis is a veritcal rule of the range.
|
||||
// There can be (2) y-axes; a primary and secondary.
|
||||
|
|
@ -15,7 +12,8 @@ type YAxis struct {
|
|||
|
||||
Zero GridLine
|
||||
|
||||
AxisType YAxisType
|
||||
AxisType YAxisType
|
||||
Ascending bool
|
||||
|
||||
ValueFormatter ValueFormatter
|
||||
Range Range
|
||||
|
|
@ -74,8 +72,6 @@ func (ya YAxis) GetGridLines(ticks []Tick) []GridLine {
|
|||
|
||||
// Measure returns the bounds of the axis.
|
||||
func (ya YAxis) Measure(r Renderer, canvasBox Box, ra Range, defaults Style, ticks []Tick) Box {
|
||||
sort.Sort(Ticks(ticks))
|
||||
|
||||
var tx int
|
||||
if ya.AxisType == YAxisPrimary {
|
||||
tx = canvasBox.Right + DefaultYAxisMargin
|
||||
|
|
@ -128,8 +124,6 @@ func (ya YAxis) Render(r Renderer, canvasBox Box, ra Range, defaults Style, tick
|
|||
tickStyle := ya.TickStyle.InheritFrom(ya.Style.InheritFrom(defaults))
|
||||
tickStyle.WriteToRenderer(r)
|
||||
|
||||
sort.Sort(Ticks(ticks))
|
||||
|
||||
sw := tickStyle.GetStrokeWidth(defaults.StrokeWidth)
|
||||
|
||||
var lx int
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue