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

311
Views
¿Cómo puedo mostrar el símbolo de porcentaje dentro de chartjs?

Ya puedo recuperar los valores correctos para el porcentaje. ¿Cómo puedo mostrar el símbolo de porcentaje para cada uno de los valores? los códigos para el gráfico:

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

0

La información sobre herramientas se puede modificar así

 <Line data={{ <snip> options={{ maintainAspectRatio: false, title: { display: true, text: "Hello", fontSize: 20 }, plugins: { tooltip: { callbacks: { label: function(context) { var label = context.dataset.label || ''; if (context.parsed.y !== null) { label += ' ' +context.parsed.y + '%'; } return label; } } } }, scales: { y: { min: 0, max: 100, ticks: { stepSize: 20, callback: function (value, index, values) { return value + " %"; } } } }, legend: { labels: { fontSize: 25 } } }} />
about 4 years ago · Juan Pablo Isaza Report

0

Puede editar la propiedad ticks de esta manera:

 scales: { y: { min: 0, max: 100, ticks: { stepSize: 20, callback: function(value, index, values) { return value + " %"; } } } },

Lo encontré aquí: https://www.chartjs.org/docs/latest/axes/labelling.html#creating-custom-tick-formats

Parece funcionar:

ingrese la descripción de la imagen aquí

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!