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

area和column曲线X轴问题 #79

Closed
yukunyi opened this issue Apr 12, 2017 · 6 comments
Closed

area和column曲线X轴问题 #79

yukunyi opened this issue Apr 12, 2017 · 6 comments

Comments

@yukunyi
Copy link

yukunyi commented Apr 12, 2017

设置了最小值为0,最大值为10,如果数据类似[5,0,0]有最小值存在的话,曲线的部分会在X轴下部分出现

@xiaolin3303
Copy link
Owner

这个问题有点复杂,正在研究如何解决

@hoganjobs
Copy link

1、
你好,在使用中绘制曲线时发现,类似[12, 1 , 0 , 0]的数据,在绘制1和0之间的曲线时,控制点pAy的值会超过1点p[1]y的值,导致曲线出现到X轴下部分。因为计算1点的时候执行以下判断不生效,数值12的点和数值1的点y轴值差值大,实际计算出数值1的点的 pAy超出了X轴。
if (isNotMiddlePoint(points, i)) {
pAy = points[i].y;
}
2、
建议再细化一下,增加限制曲线的控制点。
我自己目前的解决是粗略地增加直接判断pAy、pBy两个控制点,限制不超出曲线初始和结束两点间Y轴值。
if (pAy >= Math.max(points[i].y, points[i + 1].y) || pAy <= Math.min(points[i].y, points[i + 1].y)) {
pAy = points[i].y;
}
if (pBy >= Math.max(points[i].y, points[i + 1].y) || pBy <= Math.min(points[i].y, points[i + 1].y)) {
pBy = points[i + 1].y;
}

@HanAsteroid
Copy link

这个问题还是没解决啊
image

@HanAsteroid
Copy link

加上楼上的解决方案,可以了,不过有点丑,希望解决
image
// fix issue #79
if (isNotMiddlePoint(points, i + 1)) {
pBy = points[i + 1].y;
}
if (isNotMiddlePoint(points, i)) {
pAy = points[i].y;
}
// add github simple sloution
if (pAy >= Math.max(points[i].y, points[i + 1].y) || pAy <= Math.min(points[i].y, points[i + 1].y)) {
pAy = points[i].y;
}
if (pBy >= Math.max(points[i].y, points[i + 1].y) || pBy <= Math.min(points[i].y, points[i + 1].y)) {
pBy = points[i + 1].y;
}

@449241526
Copy link

能不能手动控制x轴两点的间距,demo里面的是如果x轴两点间的文字过长,显示是斜着的效果,如果文字不够长,那么显示在两点间,能不能手动控制两点距离

@ysqjal
Copy link

ysqjal commented Jan 11, 2022

请问tooptip如何显示的

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

6 participants