FLOT 工具提示放置?
似乎没有办法让我的图表中的工具提示不再显示在右下角?这看起来非常直观,但我找不到将其放在数据点上方或左侧的方法。有什么建议吗?谢谢,
我想改变函数中的顶部/底部、左/右就可以做到这一点,但没有运气
code
function showTooltip(x, y, contents) {
$('<div id="tooltip">' + contents + '</div>').css( {
position: 'absolute',
display: 'none',
bottom: y - 35,
left: x + 10,
border: '1px solid #fdd',
padding: '2px',
'background-color': '#fee',
opacity: 0.80
}).appendTo("body").fadeIn(200);
}
code
There doesn't appear to be a way to move the tooltip in my graph from showing up on the bottom right? This seems very intuitive but I can't find a way to put it above or to the left of the datapoint. Any suggestions? Thanks
I was thinking that changing the top/bottom, left/right in the funciton would do it but no luck
code
function showTooltip(x, y, contents) {
$('<div id="tooltip">' + contents + '</div>').css( {
position: 'absolute',
display: 'none',
bottom: y - 35,
left: x + 10,
border: '1px solid #fdd',
padding: '2px',
'background-color': '#fee',
opacity: 0.80
}).appendTo("body").fadeIn(200);
}
code
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用您的语法,看起来 顶部和左侧的组合 放置得很好(免责声明,我只有方便的 Firefox 才能尝试)。
Using your syntax, it looks like the combination of top and left place it pretty well (disclaimer, I only have Firefox handy to try it).
您应该使用 Craig qTip 2 插件来获得更好看的工具提示,并且(我几乎可以肯定)能够将工具提示从点移动到您想要的位置。
在这里您可以找到一个示例:
http://craigsworks.com/projects/qtip2/demos/flot
,lowwing 链接将带您进入这个很棒的插件的整个页面http: //craigsworks.com/projects/qtip2/demos/
这是发布示例中使用的代码,也许它对您的目的有用...
我正在研究大量 Flot 实际应用,所以我们应该保持自己的状态像这样触摸插件没有很好的指南。
You should use the Craig qTip 2 plug-in to get a better looking tooltip and (I am almost sure) the ability to move the tool tip where you want from the point.
Here you can find an example:
http://craigsworks.com/projects/qtip2/demos/flot
and the lowwing link bring you to the whole page of the awesome plug-inhttp://craigsworks.com/projects/qtip2/demos/
That's the code used in the posted example, maybe it could be useful for your purpose...
I am studying lots of Flot practical application so we should keep ourself in touch as this plug-in doesn't have a great guide.