这可能真的很简单。我希望添加一个链接到另一个页面。我正试着通过d3添加它。我要在JS中添加另一个属性吗?Iv尝试了.attr("src","newPage.html")和.attr("url","newPage.html"),但都不起作用。
任何建议都将不胜感激。谢谢。
//JS
var newLink = d3.select(".chart")
.append("div")
.html("Trend Graph")
.attr("class", "populationTrend")
//CSS
.populationTrend{
font-weight:400;
margin-top:-15%;
cursor:pointer;
padding-left:70%;
background-color:#039;
} 发布于 2013-05-09 20:17:08
要添加“普通”链接(即锚标签),您只需执行以下操作
d3.select(".chart")
.append("a")
.attr("href", "newPage.html")
.html("new page");甚至是
d3.select(".chart")
.append("div")
.html("<a href='newPage.html'>new page</a>");https://stackoverflow.com/questions/16461512
复制相似问题