我想按以下方式在行周围添加边框(悬停的单元格有自己的描边):
但是,我只能做到这一点:
为了创建热图,我使用了https://d3-graph-gallery.com/graph/heatmap_basic.html网页中的示例代码。
以下是我当前添加笔划的方式:
svg_heatmap.selectAll("rect")
.style("stroke", "none")
.filter(d => d.group == this.__data__.group || d.variable == this.__data__.variable)
.style("stroke", "black")
我试过用stroke-dasharray
,但没有用。我有点难住了。
1条答案
按热度按时间bwitn5fc1#
你可以为每一行/列添加一个额外的rect。
基于https://d3-graph-gallery.com/graph/heatmap_basic.html网页中的示例代码,您可以尝试执行以下操作。