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

156
Vistas
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 Respuestas
Responde la pregunta

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 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