Data visualisation with d3-add labels to d3 elements

svg.selectAll(“text”)

   .data(dataset)

   .enter()

   // Add your code below this line

   .append("text")

   .attr("x",(d,i)=>i*30)

   .attr("y", (d, i) => h - 3 * d-3)

   .text((d,i)=>d)

   // Add your code above this line
1 Like

Hi @shivamadlakha,

You did not include your query about this challenge :slight_smile:

I ran you code and it works so providing you have not changed anything above “Add your code below this line”, it should work.

I hope this helps but if not, let us know.

1 Like