font size is not working in my d3.js code

I think you'll find it works if you assign font-size as a style rather than as an attribute.

.style("font-size", "34px")

(better yet, assign an id or class attribute and set all your styles in CSS)