簡體   English   中英

如何在默認情況下更改R中d3heatmap中的infowindow字幕?

[英]How to change infowindow captions in d3heatmap in R from the default?

我使用d3heatmap包在R中制作了下面的熱圖。 是否可以將行,列,值更改為自定義標簽? 在此輸入圖像描述

我找不到有關編輯背景顏色/透明度/字體等的庫信息。

我有同樣的問題。 解決方案是“hacky”,但是會得到你想要的。 你需要在d3heatmap庫中找到heatmapcore.js文件:d3heatmap / htmlwidgets / lib / d3heatmapcore / heatmapcore.js

找到以下行:

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");

您可以將“行”,“列”和“值”替換為所需的文本。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM