Adding Variables to href link for d3/javascript object tooltip

d0td4sh

New Member
So here's what I'm doing:\[code\]var selection = canvas.selectAll("circle").data(data); selection.enter().append("circle") selection .attr("title", function(d){ return "<div class='candtip'>"+d.Name+"<br /><a href='http://stackoverflow.com/questions/13828946/Twitter.com/'+d.Twitter><img src='http://stackoverflow.com/questions/13828946/Twitter.png'/></a></div>"})\[/code\]So for each element I have a tooltip show up that shows that displays Twitter's logo and then I would like that when you click on that picture it brings you to that persons Twitter page but I can't seem to get the href part to work correctly. The way the data is set up is that 'd.Twitter' is a variable that holds the id of that persons Twitter page, so if the page was Twitter.com/OprahWinfrey , then d.Twitter = OprahWinfrey.Any help would be appreciated.
 
Back
Top