[英]How to change infowindow captions in d3heatmap in R from the default?
I had the same problem. 我有同样的问题。 The solution is "hacky", however will get you what you want.
解决方案是“hacky”,但是会得到你想要的。 You need to find heatmapcore.js file within the d3heatmap library: d3heatmap/htmlwidgets/lib/d3heatmapcore/heatmapcore.js
你需要在d3heatmap库中找到heatmapcore.js文件:d3heatmap / htmlwidgets / lib / d3heatmapcore / heatmapcore.js
Find the following lines: 找到以下行:
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");
You can replace "Row", "Column" and "Value" with the text you want. 您可以将“行”,“列”和“值”替换为所需的文本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.