test: add test for axis
This commit is contained in:
parent
635e440e85
commit
d3c6649cd9
12 changed files with 145 additions and 40 deletions
10
range.go
10
range.go
|
|
@ -115,13 +115,3 @@ func (r *axisRange) GetRange(index int) (float64, float64) {
|
|||
func (r *axisRange) AutoDivide() []int {
|
||||
return autoDivide(r.size, r.divideCount)
|
||||
}
|
||||
|
||||
func (r *axisRange) getWidth(value float64) int {
|
||||
v := value / (r.max - r.min)
|
||||
// 移至居中
|
||||
if r.boundary &&
|
||||
r.divideCount != 0 {
|
||||
v += 1 / float64(r.divideCount*2)
|
||||
}
|
||||
return int(v * float64(r.size))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue