in this codepen 1: https://codepen.io/Siddharth11/pen/LVQmjN
I understand d3js is being used here.
When I use the browser to check ,i see all the class.Plz se
The text attribute changes the innerHTML of the
. Right now it is color[i]
. Change it to change the labels. I suggest you to read the documentation of d3. https://github.com/d3/d3/wiki
text.enter()
.append('text')
.attr('dy', '0.35em')
.style("opacity", 0)
.style('fill', (d, i) => colors[i])
.text((d, i) => colors[i]) //<-- Change here
.attr('transform', d => {
// calculate outerArc centroid for 'this' slice
let pos = outerArc.centroid(d)
// define left and right alignment of text labels
pos[0] = radius * (midAngle(d) < Math.PI ? 1 : -1)
return `translate(${pos})`
})
.style('text-anchor', d => midAngle(d) < Math.PI ? "start" : "end")
.transition()
.delay((d, i) => arcAnimDur + (i * secIndividualdelay))
.duration(secDur)
.style('opacity', 1)