DOM ToolTip on recreate chart
Posted: Wed Aug 12, 2015 10:48 am
Hi,
I have a problem with DOM ToolTip.
In my project I create a chart in my html document.
I can need to remove this chart and create new one.
When I do that the tooltip is not display any more. (to be more correct the left and top of the toolTip DIV are not changed and are out of the display).
I think the problem is that the Tee.DOMTip function. It is created only once for the html and the object tt is not recreated.
Something with this object not working well when I replace the chart in my html.
To work around the problem I modify the teechat.js and some code in my JavaScript.
In Tee.DOMTip I added the code:
In my code before creating the chart I added the code:
I'm not sure this is the best way to do it, maybe there is another way, or better to check why the x,y positions are not updated correctly after I remove a chart and create new one.
Thanks
Amos
I have a problem with DOM ToolTip.
In my project I create a chart in my html document.
I can need to remove this chart and create new one.
When I do that the tooltip is not display any more. (to be more correct the left and top of the toolTip DIV are not changed and are out of the display).
I think the problem is that the Tee.DOMTip function. It is created only once for the html and the object tt is not recreated.
Something with this object not working well when I replace the chart in my html.
To work around the problem I modify the teechat.js and some code in my JavaScript.
In Tee.DOMTip I added the code:
Code: Select all
show: function (v, w, dest, domStyle)
{
/////////////// start of added code ////////////////////
var tt1 = document.getElementById('teetip1');
if (!tt1 )
{
if (tt)
clearInterval(tt.timer);
tt = null;
}
// ///////////end of added code//////////////////////
if (!tt){
tt = document.createElement('div');
tt.setAttribute('id','teetip1');
….
Code: Select all
var tt = document.getElementById('teetip1');
if (tt != null)
if (tt.parentNode != null)
tt.parentNode.removeChild(tt);
Thanks
Amos