Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
toDataUrl() da una imagen en blanco

Vi esta pregunta respondida varias veces pero no he encontrado una solución. No pondré todo dentro del gráfico porque es una función bastante larga y funciona perfectamente, así que no creo que el problema esté ahí, por favor ayuda :´(

JS: Sé que faltan algunos '}', solo copié la parte importante

 var ctx = document.getElementById("myChart").getContext("2d"); ctx.fillStyle = "#FF0000"; ctx.fillRect(20, 20, 150, 100); var myChart = new Chart(ctx, { type: 'scatter', data: { datasets: [{ label: 'Tiempo-Hole', borderColor: window.chartColors.red, fill: false, pointRadius: 0, data: storage, showLine: true, }, options: { bezierCurve : false, animation: { onComplete: done }, } } }); ``` function done(){ alert("haha"); var chartR = document.getElementById("myChart"); var img = chartR.toDataURL("image/png"); document.getElementById('base64').value = img; } PHP/HTML: This goes inside some divs, etc... <img name="base64" id="base64" src=""> <canvas id="myChart"></canvas>
about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!