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

96
Views
Mostrar y trazar valores cero en el gráfico de líneas ChartJS cuando no hay datos

Tengo un script que usa ChartJS para trazar el rendimiento de un código QR en términos de escaneos y usuarios únicos. El gráfico solo representa las interacciones con el QR, omitiendo aquellos días en los que no hay interacción con él.

Me gustaría incluir esos días trazando 0 como valor para ese día en caso de que no ocurra ninguna interacción. ¿Alguna sugerencia sobre cómo lograr esto?

este es el codigo:

 /* Display chart */ new Chart(pageviews_chart, { type: 'line', data: { labels: <?= $data->pageviews_chart['labels'] ?>, datasets: [ { label: <?= json_encode(l('link_statistics.pageviews')) ?>, data: <?= $data->pageviews_chart['pageviews'] ?? '[]' ?>, backgroundColor: pageviews_gradient, borderColor: pageviews_color, fill: true }, { label: <?= json_encode(l('link_statistics.visitors')) ?>, data: <?= $data->pageviews_chart['visitors'] ?? '[]' ?>, backgroundColor: visitors_gradient, borderColor: visitors_color, fill: true } ] }, options: chart_options });

¡gracias!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Simplemente pase 0 como valor. No podemos ayudarlo con su back-end, sin más información.

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