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

折线图自定义了tooltip后,画布边界的tooltip显示会越界(不能像默认的tooltip自动显示到可视区域) #18

Closed
francis-su opened this issue Sep 13, 2016 · 4 comments

Comments

@francis-su
Copy link

francis-su commented Sep 13, 2016

@lifesinger 如题,使用教程里推荐的自定义API:

        chart.tooltip(true, {
            custom: true, // 表示使用自定义的模板显示 tooltip
            html:  '<div class="chart-tooltip" style="position:absolute;visibility: hidden;"><span class="ac-title"></span>:00<table class="ac-list custom-table"></table></div>', // tooltip 的 html 外层模板
            itemTpl: '<tr><td>{index}</td><td>{name}:</td><td>{value}元</td></tr>', // 使用 html 时每一个显示项的模板,默认支持 index, color, name, value 这四个字段。
            offset: 50, // 偏移量,设置tooltip 显示位置距离 x 轴方向上的偏移
            //customFollow: false // 设置 tooltip 是否跟随鼠标移动,默认为 true,跟随。
        });

截屏参见如下:
screen shot 2016-09-14 at 00 49 03

@francis-su
Copy link
Author

。。。

@dxq613
Copy link
Member

dxq613 commented Sep 22, 2016

自定义的tooltip,确实没有做边距检测。计划后面的版本默认就是html的了,边距检测是必须要做的。

@simaQ
Copy link
Contributor

simaQ commented Nov 4, 2016

@francis-su 不好意思回复晚了, 你使用 2.0.5 及以上的版本看下,是否还存在这个问题,我们对这个做了优化。

@dxq613
Copy link
Member

dxq613 commented Nov 18, 2016

已经修复,但是还有其他团队要求不要限制自定义tooltip的范围,特别是地图场景下,有时候需要稍微远离一下canvas画布。

@dxq613 dxq613 closed this as completed Nov 18, 2016
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

3 participants