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

273
Views
mostrar valores porcentuales en lugar de valor

Estoy usando los gráficos de vértice para generar una "rosquilla". Si muevo el cursor sobre un elemento, me mostrará el valor de este elemento:

ingrese la descripción de la imagen aquí

Mi código para esto:

 plotOptions: { pie: { donut: { labels: { show: true, value: { formatter: function (val) { return val; } } } } } }

Pero, ¿cómo puedo mostrar el valor porcentual del elemento en lugar del "valor normal"?

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

0

Creo que la única forma es calcular los porcentajes tú mismo.

 formatter: function (val,chart) { if(val){ let valPercent = val/chart.config.series.reduce((a, b) => a + b, 0)*100; return `${valPercent.toFixed(1)}%`; // or round with Math } return '' }

En realidad, hay una matriz con valores porcentuales chart.globals.seriesPercent pero no se proporciona seriesIndex

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!