test: add test for axis

This commit is contained in:
vicanso 2022-06-18 10:38:46 +08:00
parent 635e440e85
commit d3c6649cd9
12 changed files with 145 additions and 40 deletions

View file

@ -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))
}