Flot within jquery qtip?

冷暖自知 提交于 2019-12-12 02:18:31

问题


I'm trying to replicate what Amazon, Trip Advisor etc are doing and showing a tooltip type interface when hovering over an average review score to show the breakdown of scores in bar chart format - on the qtip forums it's said to use Flot (my first time using it as normally use google charts) but whilst the graph renders fine on the page when I take it outside of the tooltip, as soon as I put the div within it it doesn't work.

My page is: http://solicitor.info/demo/solicitors/?id=15

Can anyone please see what I'm doing wrong?


回答1:


When I hit your page, I get a javascript error:

Uncaught Invalid dimensions for plot, width = null, height = null

I'm guessing it is trying to render the plot while the "placeholder" div is still hidden inside the qtip.

I would try moving the $.plot call into a qtip onShow callback. That way you are sure the div is shown before trying to render the plot.



来源:https://stackoverflow.com/questions/11275481/flot-within-jquery-qtip

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!