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

326
Vistas
how to display the first and last grid complete in chart js in type line

I am new to chart js and want to implement it in reactjs project. I am using a line graph and want to display the tick under each image. For that purpose, I assigned a dynamic width to the line graph i.e. if there is 2 image then the width will be multiplied by 2 and if the image is 3 then the width should be multiplied by 3, and so on. The trick works somehow because I used the offset to true to display the labels in the center.

Now the issue I am facing is the first and last columns because they are not complete.

My question is how I can make them look complete.

What is the current result

enter image description here

I want the first label should start in the middle complete.

enter image description here

The first grid will display the tick in the middle also.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

scales: {
      x: {
        offset: true,
        grid: {
          offset: true,
        }
      },
      y: {
        beginAtZero: true,
        min: 0,
        max: 10,
        ticks:{
          autoSkip: true,
        }
      },
    }

In such a case, you will need to add offset to the X. For more detail please visit https://github.com/chartjs/Chart.js/issues/8745

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