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

145
Views
Eliminar el tiempo de animación para los puntos de datos chartjs

He creado un gráfico de líneas simple en chartjs. cuando paso el mouse sobre un solo punto de datos, aparece un cuadro que me dice el valor de los datos, el valor del eje x y el nombre de la estadística. El cuadro negro no aparece de inmediato, hay un fundido de entrada. Me gustaría que el cuadro apareciera inmediatamente sin aparición gradual, por lo que básicamente estoy tratando de establecer el tiempo de animación en 0. ¿Cómo hago esto?

A continuación se muestra cómo se está escribiendo el gráfico en este momento:

 chart_code = new Chart(ctx, { type: 'line', data: { labels: ['A','B','C','D','E'], datasets: [{ label: 'Teststatistic', data: [50,40,30,20,50], backgroundColor: ['rgba(0, 105, 146, 1)'], borderColor: ['rgba(0, 105, 146, 1)'], borderWidth: 3, fill: false, pointStyle: 'rect', pointRadius: 5 }] }, options: { responsive: false, plugins: { legend: { display: false, boxWidth: 80, boxHeight: 80 } }, scales: { x: { ticks: { maxRotation: 0, minRotation: 0 } } } }

}

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

0

Puede configurar la animation en false en la configuración de información sobre herramientas de esta manera:

 var options = { type: 'line', data: { labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"], datasets: [{ label: '# of Votes', data: [12, 19, 3, 5, 2, 3], borderColor: 'pink' }, { label: '# of Points', data: [7, 11, 5, 8, 3, 7], borderColor: 'orange' } ] }, options: { plugins: { tooltip: { animation: false } } } } var ctx = document.getElementById('chartJSContainer').getContext('2d'); new Chart(ctx, options);
 <body> <canvas id="chartJSContainer" width="600" height="400"></canvas> <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.7.0/chart.js"></script> </body>

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!