Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

515
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda