I am displaying a graph with text and links below the graph. All the code is in SVG. Below is my text code and below that is my html code. The text displays in all tested browsers (including IE) The hmtl code displays fine in Chrome and Firefox but not in IE.
svg.append("text")
.attr("class", "spikes")
.attr("transform", "translate(" + (margin.left) + "," + (totalHeight + labelMargin * 3) + ")")
.style("font-size", "1.2em")
.style("font-weight", "bold")
.style("text-anchor", "start")
.text("Total SF Represented: " + squareFt);
var spikesLinkText = "Invalid Interval Usage Spikes Removed: " + numberOfSpikesTotal;
svg.append("text")
.attr("class", "spikes")
.attr("transform", "translate(" + (margin.left + graphWidth) + "," + (totalHeight + labelMargin * 2) + ")")
.style("font-size", "1.2em")
.style("font-weight", "bold")
.style("text-anchor", "end")
.html("<a href='#'>" + spikesLinkText + "</a>")
.on("click", function (d) {
onClickNumberSpikes();
});
Also, when I inspect the source in IE this links are not there. But they are there in Chrome and Firefox. What do I need to change to make the html code be included and display in IE?
onClickNumberSpikes = function () {
$('#numberOfSpikesModal').foundation('reveal', 'open');
initNumberOfSpikesTable(stateMap.hierarchyId);
}
Ended up changing the link to text and adding a style in the .css file to make the text look like a link on hover.
svg.append("text")
.attr("class", "spikes plink")
.attr("transform", "translate(" + (margin.left + graphWidth) + "," + (totalHeight + labelMargin * 2) + ")")
.style("font-size", "1.2em")
.style("font-weight", "bold")
.style("text-anchor", "end")
.text("Invalid Interval Usage Spikes Removed: " + numberOfSpikesTotal)
.on("click", function (d) {
onClickNumberSpikes();
});
.plink:hover {
text-decoration: underline;
cursor: pointer;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.