Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何优化坐标系 Y 轴区间 #1

Open
xingdongyu1994 opened this issue Dec 27, 2018 · 1 comment
Open

如何优化坐标系 Y 轴区间 #1

xingdongyu1994 opened this issue Dec 27, 2018 · 1 comment

Comments

@xingdongyu1994
Copy link
Contributor

No description provided.

@xingdongyu1994
Copy link
Contributor Author

比如说y轴需要的数据是 const data = [10,40,70,20,50,30]
那我们y轴所需要的区间是
一开始想
1.极差 const range = (70-10) / data.length =10
那y轴上每一个点的波动区间 正负10

2.重组每一项数据
let res = []
for(let i=0; i<data.length; i++){
res.push(data[i]+10)
}
3.结果 [20,50,80,30,60,40]

这样一个简单的计算 在y轴上上下都留了空间但是换成写其他数据比如
[15,13,22,45,47]
这些数据在坐标系上就有点错位

不知道还可以如何优化

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant