I would like to change the appearance of the tooltip in svg elements (header) by any means like js or css.
I even tried things like this:
var title = document.createElementNS('http://www.w3.org/2000/svg','title');
title.textContent='<foreignObject width="100" height="50" requiredExtensions="http://www.w3.org/1999/xhtml"><div style="background:blue;">'+arr[j].ypos+'</div><foreignObject>';
rect.appendChild(title);
but no matter what I insert as the textContent header, it just displays as a string.
Is there a way to style the default tooltip? Other simple and simple alternatives for creating tooltips in svg without using any plugins are also welcome ...
source
share