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

197
Views
chart.js escala xaxis con fecha, renderizador extraño

Hola, obtuve este renderizador con mi configuración en chart.js, no entiendo por qué obtuve

ingrese la descripción de la imagen aquí

esta es la versión de chart.js

 /*! * Chart.js * http://chartjs.org/ * Version: 2.7.1 * * Copyright 2017 Nick Downie * Released under the MIT license * https://github.com/chartjs/Chart.js/blob/master/LICENSE.md */

genero mi gráfico con esta función y no entiendo cómo solucionar mi problema gracias por su ayuda

 new Chart(document.getElementById("line-chart"), { type: 'line', data: { labels: datadate, datasets: [{ data: datavalue, label: "Value array", borderColor: "#3e95cd", pointRadius: 3, pointHoverRadius: 3, fill: false } ] }, options: { title: { display: true, text: 'returned value' }, scales: { yAxes: [{ ticks: { beginAtZero: false } }], xAxes: [ { type: 'time', time: { min: Math.min.apply(null, datadate), max: Math.max.apply(null, datadate) } }], }, responsive: true } });

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

0

Actualice su versión de Chart.js a 3.0.0 o superior en lugar de 2.7.1 , funciona bien en versiones actualizadas.

vea el siguiente ejemplo que se hace en Chart.js versión 3.0.0 .

Nota : a continuación se muestra un ejemplo de gráfico de líneas simple.

 const ctx = document.getElementById("tests-chart"); const data =[ { x: "24/03/2022", y: 20 }, { x: "25/03/2022", y: 5 }, { x: "24/06/2022", y: 10 }, { x: "25/06/2022", y: 5 } ]; const testsChart = new Chart(document.getElementById("tests-chart"), { type: 'line', data: { datasets: [{ data: data, label: "Value array", borderColor: "#3e95cd", pointRadius: 3, pointHoverRadius: 3, fill: false } ] }, });
 <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.0.0/chart.min.js"></script> <div> <canvas id="tests-chart"></canvas> </div>

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!