Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

327
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda