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

218
Views
Manipular el posicionamiento de la etiqueta del eje x. Reaccionar Chartjs 2

Estoy tratando de hacer un gráfico de área que tenga etiquetas de eje x que se muestren sobre el eje real. Aquí hay un ejemplo:

ingrese la descripción de la imagen aquí

Tengo las etiquetas de los ejes, pero no encuentro la manera de moverlas justo encima del eje X.

 Chart.register(CategoryScale, LinearScale, PointElement, LineElement, Title, Filler) const options = { layout: { padding: { top: 50 } }, responsive: true, elements: { line: { tension: 0.4, // makes the line smoother }, point: { radius: 0, }, }, scales: { x: { grid: { display: false, // hides lines in background drawBorder: false, }, }, y: { beginAtZero: true, grid: { display: false, // hides lines in background drawBorder: false, }, ticks: { display: false, }, }, }, } const chartData = { labels: ['JAN', 'FEB', 'MAR', ...], datasets: [ { data: [12, 79, 56, ...], borderWidth: 5, }, ], } export const Graph = () => { return ( <div> .... <Line plugins={plugins} options={options} data={chartData} /> </div> ) }

Necesito que responda, pudiendo cambiar la ventana de tiempo que se grafica. Traté de hacer una función afterDraw (), sin embargo, eso no es ideal dada la necesidad de responder.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Después de investigar un poco, pude encontrar esta solución:

 const options: { ... scales:{ x: position: { y: 20 } }. <------------------ Answer here }
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!