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

161
Visualizações
How to set and adjust plots with equal axis aspect ratios - CHART.js

I have a project where I show the movements of the robot, I want to make this map so that the x and y scales are proportional to each other. These data are real-time data, which, as I mentioned, shows the movement of a robot. Can anyone help me with this?

This is the figure: enter image description here

myChart = new Chart(ctx, {

type: 'scatter',

data: {

    datasets: [{

        label: '',

        backgroundColor: "blue",
        
        fill: false,

        data: [],

    }]

},

options: {

    scales: {

        xAxes: [{

            ticks:{

                suggestedMax:15,

            }

        }]

        yAxes: [{

            ticks:{

                suggestedMax:15,

            }

        }]

    }

}

});
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can define the desired dimension of your canvas through the width or height property.

<canvas id="chartContainer" width="400"></canvas>

...or using CSS.

canvas {
  width: 400px;
}

Further you should also define responsive: false and aspectRatio: 1 within the chart options, latter represents a square canvas.

options: {
  responsive: false,
  aspectRatio: 1,

See Configuration Options at the Chart.js documentation

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