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

141
Vistas
Adding a point with animation results in weird behavior

When I try to add a point with animations in High Charts, it results in this weird behavior:

Highcharts.chart('container', {
    chart: {
        events: {
            load: function () {
                var animate = {duration: 5000};
                var series = this.series[0];
                setInterval(function () {
                    var x = (new Date()).getTime(), // current time
                    y = Math.random();
                    series.addPoint([x, y], true, true, animate);
                }, 5000);
            }
        }
    },

    xAxis: {
        type: 'datetime'
    },

    series: [{
        name: 'Random data',
        data: (function () {
            var data = [],
                time = (new Date()).getTime(),
                i;

            for (i = -19; i <= 0; i += 1) {
                data.push({
                    x: time + i * 1000,
                    y: Math.random()
                });
            }
            return data;
        }())
    }]
});

This is the behavior I would like to achieve but instead of taking 1 second to render, I would like each point to take 5 seconds to render. How can I achieve this?

about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

Something happens that makes the animation take a little bit longer to finish its duration. So the chart will be redrawn to a different shape everytime you put extremely close or equal values for the setInterval and for the duration.

As a workaround, try adding a slightly higher interval of addition to the points enough to become unnoticed the difference. I.e: 100 MS more or 5100

about 4 years ago · Santiago Gelvez 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