2016-10-18 2 views
0

d3 툴팁에 이미지를 플롯하기 위해이 코드를 어떻게 변경합니까?javascript/d3 - 툴팁의 이미지

var tip = d3.tip() 
    .attr('class', 'd3heatmap-tip') 
    .html(function(d, i) { 
     return "<table>" + 
     "<tr><th align=\"right\">Row</th><td>" + htmlEscape(data.rows[d.row]) + "</td></tr>" + 
     "<tr><th align=\"right\">Column</th><td>" + htmlEscape(data.cols[d.col]) + "</td></tr>" + 
     "<tr><th align=\"right\">Value</th><td>" + htmlEscape(d.label) + "</td></tr>" + 
     "</table>"; 
    }) 
    .direction("se") 
.style("position", "fixed"); 

불행하게도 나는

+1

내가 생각하는 테이블보다는 img 태그를 사용하십시오. –

답변

0

당신은 foxToolTip.js를 사용하여 시도 할 수 있습니다 ...이 경우에 재현 예를 구성 모르겠어요. 도구 설명 내에서 이미지를 사용하는 방법과 d3과 함께 사용하는 방법에 대한 예가 있습니다.

https://github.com/MichaelRFox/foxToolTip.js