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

132
Views
La función de devolución de llamada de los ejes chart.js no recibe ningún dato global

Cuando trato de usar una variable global en esta función, siempre me quedo sin definir. En el eje y necesito tener valores fijos, por ejemplo: Falla y Saludable, pero chart.js funciona dinámicamente y agrega valores.

 ticks: { beginAtZero: true, max: this.numberOfMax, // autoSkip: false, callback: function(value, index, values) { console.log(value) if (values.length == 7) { console.log(this.currentClicked) switch(value) { case 0: return "Healthy" case 1.0: return "Inner Race Fault" case 2.0: return "Outer Race Fault" case 3.0: return "Roller Element Fault" } } else if (values.length == 11) { switch(value) { case 0: return "Healthy" case 1.0: return "Fault" } } }

Entonces, cuando, por ejemplo, configuro max: 1, entonces los valores tienen una longitud de 11 o cuando configuro max: 3, entonces es 7. ¿Quizás hay una manera de establecer el número de valores de la misma manera que la propiedad max?

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!