Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

516
Views
how can we add text to a svg circle in d3js

I'm trying to put text inside circle which is created by d3js, how can I do that?

const svg = d3.select("#circle").append("svg").attr("width", 300).attr("height", 300)
const text = ['Team']
svg.append('circle')
  .attr('cx', 100)
  .attr('cy', 75)
  .attr('r', 35)
  .attr('stroke', '#41778D')
  .attr('stroke-width', 5)
  .attr('fill', '#ffffff');

svg.append('circle')
  .attr('cx', 100)
  .attr('cy', 75)
  .attr('r', 27)
  .attr('stroke', '#41778D')
  .attr('fill', '#ffffff');
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Similar to appending your circles:

svg.append('text')
  .text(text[0])
  .attr('y', 100)
  .attr('x', 75)

You'll need to adjust based on the alignment and anchoring/

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!