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

237
Visualizações
Google Charts never render on slow network connections

We use Google Charts in our application to render donut charts. One user has reported Javascript errors showing instead of the chart, and I've been trying to simulate this. The closest I can get is to throttle the network speed in the browser to a very slow connection (e.g. GPRS in Firefox, or 20kbps in Chrome). The causes some unusual things to happen that I did not expect.

Using the example Google donut chart code (verbatim - to prove that call backs are set) with a throttled connection (Fiddle here for convenience):

Firefox

Firefox never renders the charts. The callback method never gets invoked. It's as if the browser "forgets" the callback, or the callback has a timeout property:

enter image description here

Chrome

Chrome does not render the chart, and intermittently displays errors relating to arrayToDataTable. I searched extensively for these errors, and all solutions appear to related to the callback not being used correctly (e.g. rendering without waiting for the script to load). Its like Chrome either gives up waiting and executes the callback anyway, or just aborts the logic flow.

enter image description here

Points for clarity

  1. Can anyone advise if setOnLoadCallback can timeout or abort, or callbacks in general?
  2. Is there any workaround for this behaviour on slow connections?
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

maybe try using the promise the load statement returns, rather than the callback.

for example, here is a typical statement, using the callback...

google.charts.load('current', {
  packages: ['corechart']
});
google.charts.setOnLoadCallback(drawChart);

instead, try using the promise...

google.charts.load('current', {
  packages: ['corechart']
}).then(drawChart);    // <-- load statement returns a promise
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