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

372
Views
Error de desbordamiento de la etiqueta Rechart xAxis

Tengo un problema con la biblioteca de recargas, en este caso, el componente BarChart

Lo que quiero lograr es personalizar el texto de la etiqueta en xAxis, ya creé un componente personalizado para marcar, para hacer que el texto sea demasiado largo con puntos suspensivos o algo así, pero parece que no puedo hacer nada por el desbordamiento de texto o decidir cualquier tamaño . Aquí está mi código hasta ahora:

 function renderTicks(props) { console.log(props) const space = props.width / props.visibleTicksCount console.log(space) const stringLength = props.payload.value.length * 7 console.log(stringLength) return ( <text style={{ fontSize: 10 }} width={70} verticalAnchor="start" textAnchor="middle" x={props.x} y={props.y}>{props.payload.value}</text> ) } function BarChart({ config = {}, data = {} }) { console.log(data) return ( <StyledChart width={450} height={450} data={data} > <XAxis tick={renderTicks} height={100} interval={0} dataKey="name" > <Label value="" content={<LabelCustom />} /> </XAxis> <YAxis /> <Tooltip /> <Bar dataKey="value" fill={colorsChart[0]} /> </StyledChart> ); }

Aquí está el comportamiento actual:

ingrese la descripción de la imagen aquí

Encontré muchos problemas como este buscando el problema pero no una solución válida, cualquier sugerencia es apreciada

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