Skip to content
New issue

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

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

Already on GitHub? # to your account

【需求---层叠柱状图+一条折线+可平移】 #550

Closed
ZYSHINee opened this issue Apr 8, 2019 · 6 comments
Closed

【需求---层叠柱状图+一条折线+可平移】 #550

ZYSHINee opened this issue Apr 8, 2019 · 6 comments

Comments

@ZYSHINee
Copy link

ZYSHINee commented Apr 8, 2019

作者你好,由于需求中有三种数据要展示,所以需要用到层叠柱状图和折线图混合使用,按照我的代码,初始化时柱状图每一条柱子宽度很窄,但是移动后柱子的宽度会重新渲染变宽,同时,长按显示tooltip时,会有误差,长按的是A条柱子,却显示了右边一条的tooltip.

请问下我的代码中有什么问题吗?

@army8735
Copy link
Contributor

移动变宽发现了,长按误差没有发现。

@army8735
Copy link
Contributor

定位这里:https://github.com/antvis/f2/blob/master/src/interaction/mixin/move.js#L122-L132
设置xScale的newValues的长度计算错误,minIndex出现了负值。

@army8735
Copy link
Contributor

发现是柱状图重叠了,只有1个的时候没问题,这个例子同一时间有park/combo2种,计算就出错……

@army8735
Copy link
Contributor

army8735 commented Apr 11, 2019

army8735 added a commit that referenced this issue Apr 11, 2019
army8735 added a commit that referenced this issue Apr 11, 2019
army8735 added a commit that referenced this issue Apr 11, 2019
@ZYSHINee
Copy link
Author

宽度定位到这里:https://github.com/antvis/f2/blob/master/src/geom/mixin/size.js#L17
count多了一倍导致变细。

位置定位大概:https://github.com/antvis/scale/blob/master/src/time-cat.js#L107

移动变宽的问题解决了,感谢大佬!

army8735 added a commit that referenced this issue Apr 17, 2019
leungwensen added a commit that referenced this issue Apr 17, 2019
@yubanxian2014
Copy link

我这里也出现长按会有误差,按A柱子tooltip展现的是B柱子,你解决了么?怎么解决的?

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

No branches or pull requests

3 participants