refactor: add examples of chart

This commit is contained in:
vicanso 2022-02-12 11:22:08 +08:00
parent e558634dda
commit 4262b148ca
10 changed files with 796 additions and 100 deletions

View file

@ -94,6 +94,9 @@ func (r *Range) GetRange(index int) (float64, float64) {
unit := float64(r.Size) / float64(r.divideCount)
return unit * float64(index), unit * float64(index+1)
}
func (r *Range) AutoDivide() []int {
return autoDivide(r.Size, r.divideCount)
}
func (r *Range) getWidth(value float64) int {
v := value / (r.Max - r.Min)