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

149
Vistas
Use toDataUrl 4 times or more, window.print causes a freezing tab in Chrome

I want to print charts from chartJs. For this purpose, I use the function document.getElementById('myChart').toDataURL();. The element of the id is my canvas, that is created by chartJs. Then, I build the content that I want to print. Later on, I print them using the function window.open().print().

At the beginning, it was working fine using one or two charts. But as soon as I add to the content a 4th chart, my Tab is freezing in Chrome. So I cant act in the form anymore and I have to close the Tab.

I created a jsFiddle to demonstrate it. To see the problem, you have to click on the "please print me" button.

Here is a running version, where I just print 3 Charts. You can print it as often as you want and you can use the select next to it: https://jsfiddle.net/u49e7qmL/2/

Here is a not running version, where I just print 4 Charts. As soon as you click on print, the tab makes a problem. You cannot print a 2nd time. Additionally you cannot use the select next to it. In my application, the whole tab freezes: https://jsfiddle.net/u49e7qmL/3/

What do I have to do that I can keep using the tab like when I print with just 3 elements?

about 4 years ago · Juan Pablo Isaza
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