visualization - D3.js with hyperlinks in tooltips. -
i've followed tool tip example here data visualizations book , hoped create d3.js graph utilises hyperlinked content in tooltips.
i able add hyperlinks @fernoftheandes jsfiddle version of visualisation. hyperlinked version here.
but more real world example of scatterplot hyperlinked tooltips not working. seem hrefs being added dom correctly, preventing links being selected.
this how tooltip looks after cursor hovers on 1 of points in scatterplot:
<div id="tooltip_svg_01" style="opacity: 1; left: 532.874px; top: 168px;"> <p><strong>important label heading</strong></p> <p><span id="value_tt_01">0.11318094,79</span></p> <p><a id="link_tt_01" href="https://en.wikipedia.org/wiki/2">0.11318094,79</a></p> </div> is there kind of event handling capturing click on url missing?
the reason in styles:
this line problem not allows mouse events.
pointer-events: none; your code:
#tooltip_svg_01 { position: absolute; width: 200px; height: auto; padding: 10px; background-color: white; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; -webkit-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4); -moz-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4); box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4); pointer-events: none; //this line problem } working code:
#tooltip_svg_01 { position: absolute; width: 200px; height: auto; padding: 10px; background-color: white; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; -webkit-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4); -moz-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4); box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4); } working code here
hope helps!
Comments
Post a Comment