| 1 |
function texttt(e,tt,on,t){ |
| 2 |
var ttt = getE('tooltiptext'), lines, i, ts, xpos; |
| 3 |
if(on) { |
| 4 |
lines = t.split('\\n'); |
| 5 |
xpos = '{$number:padding}px'; |
| 6 |
if(!ttt) { |
| 7 |
ttt = newel('g', { |
| 8 |
id: 'tooltiptext', |
| 9 |
fill: '{$string:colour}', |
| 10 |
'font-size': '{$number:font_size}px', |
| 11 |
'font-family': '{$string:font}', |
| 12 |
'font-weight': '{$string:font_weight}', |
| 13 |
'text-anchor': '{$string:anchor}' |
| 14 |
}); |
| 15 |
tt.appendChild(ttt); |
| 16 |
} |
| 17 |
while(ttt.childNodes.length > 0) |
| 18 |
ttt.removeChild(ttt.childNodes[0]); |
| 19 |
for(i = 0; i < lines.length; ++i) { |
| 20 |
ts = newel('text', { y: {$number:ttoffset} + ({$number:tty} * i) + 'px' }); |
| 21 |
ts.appendChild(newtext(lines[i])); |
| 22 |
ts.innerHTML = ts.textContent; |
| 23 |
ttt.appendChild(ts); |
| 24 |
} |
| 25 |
} |
| 26 |
ttt && showhide(ttt,on); |
| 27 |
return ttt; |
| 28 |
} |
| 29 |
|