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

175
Views
Problemas de anotación de Chart JS

Estoy tratando de cargar la anotación del gráfico dinámico que creo después de recibir datos de la base de datos y probé todas las opciones posibles, pero de alguna manera el gráfico se carga pero no las anotaciones.

chart.js versión = v2.9.4 chart-plugin-annotation.min.js versión = 0.5.7

Función en JS que se ejecuta cuando se reciben datos de db:

 function DrawChart(timeLabelList, unitsProducedList, goalList){ if(draw_the_chart != null) draw_the_chart.destroy(); Chart.defaults.global.defaultFontColor = 'white'; var ctx = document.getElementById('draw_the_chart').getContext("2d"); draw_the_chart = new Chart(ctx, { type: 'line', //plugins: [ChartAnnotation], data: { labels: timeLabelList, datasets: [ { label: 'Goal', yAxisID: 'A', data: goalList, //backgroundColor: chartColumnColorBlueSolid, borderColor: chartColumnColorGreenSolid, borderWidth: 2, pointStyle: 'star' }] }, options: { annotation: { annotations: [ { id: "a-line-1", type: "line", mode: "vertical", scaleID: "y-axis-0", value: "1", borderColor: "red", borderWidth: 2 } ] }, legend: { position: 'bottom', display: true, }, elements: { line: { tension: 0 } }, scales: { xAxes: [{ stacked: true, type: 'time', time: { unit: 'hour' }, }], yAxes: [{ stacked: false, id: 'A', type: 'linear', position: 'right', }] }, } }); }

Intenté todas las formas posibles de registrarme y también diferentes formas de usar el complemento, pero no tuve suerte al trazarlo. Incluso usé las últimas versiones de CDN pero no tuve suerte.

¿Alguien puede ayudar con eso?

¡Gracias!

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