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

187
Vistas
unable to add span inside svg's <g> tag

I have this below line of code

<g id="xlabels">
            {dataArray.map(({ fullName }, index) => (
                <text
                  transform={`translate(${points[index].x + 5} ${
                    graphHeight + 10
                  }) rotate(-30.38)`}
                  style={styles["xLabel"]}
                  fill={points[index].color}
                  textAnchor="end"
                >
                  {fullName}
                </text>
            ))}
          </g>

I want to add a span inside it. for e.g.

<span>{fullName}</span>

The intention of doing so is that currently the fullName gets displayed as red color because i mentioned fill={points[index].color} but i want to display the first character as black color and rest characters should remain red as earlier.

Can someone pls let me know how to do it. I read that you cannot put div or span tags inside a svg element. Any other way i can fix this or any alternate way to achieve this ?

about 4 years ago · Juan Pablo Isaza
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