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

236
Visualizações
Call addPoint hang in HighCharts

I use highcharts to show dynamical line chart, my requirement is,

  1. chart refreshes per second
  2. need to append 250 new points to chart per second
  3. keep the total number of points in chart fixed, such as keep 30 seconds, the total point is fixed as 250 * 30

I use addPoint in loop (250 times) when data generated per second, unfortunately, highcharts seems to be hang, no line showed, instead, the browse can't be clicked at all. For short loop, such as 10 times, it seems to be OK

for (var i = 0; i < 250; i++) chart.series[0].addPoint(p, true, true);

How can I refresh the line chart with delta data (250 new point) per second? I think setData is better than addPoint, but how can I append the new data list to existing data list in chart and shift the old points over 250 * 30

Thanks very much for your kindly help !

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

0

You don't need to redraw the chart after every add point operation. It is much better to do it after the whole set:

    for (let i = 0; i < 300; i++) {
        chart.series[0].addPoint(data, false);
    }

    chart.redraw();

Live demo: http://jsfiddle.net/BlackLabel/n0x9sjz7/

API Reference: https://api.highcharts.com/class-reference/Highcharts.Series#addPoint

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