I'm struggling with a simple issue here,
My goal is to add a div to my svg element containing text. I have written the code for this and in the DOM, it shows that the svg has the correct class attached along with the desired text. However, the text is not displaying on the page.
I'm hoping someone can help me identify where I've made a mistake?
Here is the snippet of the code;
http://plnkr.co/edit/LxD1TarajR8dZUS7MbHg?p=preview
var vis = d3.select("#chart").selectAll("svg")
.data(dataset)
.enter()
.append('svg')
.attr("class", "svgCircle") // Adding svg class
.attr('width', width)
.attr('height', height)
.append('g')
.attr("transform", "translate(" + width / 2 + "," + height / 2 + ")")
vis.append("circle")
.attr("fill", "#ffffff")
.attr("stroke", "#dfe5e6")
.attr("stroke-width", 1)
.attr('r', width / 2)
d3.selectAll(".svgCircle") // Append label to circles
.append("div")
.attr("class", "circleLabel")
.append("text")
.text(function(d) {
return d.label
})