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

147
Views
Cómo formatear etiquetas de eje para mostrar la fecha formateada de la marca de tiempo UNIX en Chart.js

Aquí está mi código:

 var scatterChart = new Chart(document.getElementById('chartr'), { type: 'scatter', data: { datasets: [{ data: data }], options: { scales: { xAxes: [{ type: 'time', time: { parser: 'YYYY-MMM', unit: 'month', displayFormats: { 'month': 'YYYY-MMM' } } }] } } } });

Pero el gráfico no funciona. Los datos están en forma de {momento().formato(AAAA-MMM), valor}. Nada de lo que probé funciona, aparte de alimentar los datos UNIX del gráfico, pero de esa manera el gráfico se ve feo.

Aquí está el fragmento de datos breve:

 2016-Apr: 0.6031746031746031 2016-May: 0.5079365079365079 2016-Oct: 0.4126984126984127 2017-Apr: 0.746031746031746

Puedo usar moment.js, eso ayuda.

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!