apexcharts / apexcharts.js

📊 Interactive JavaScript Charts built on SVG
https://apexcharts.com
MIT License
14.22k stars 1.29k forks source link

Add text inside the donut chart #1392

Closed myshinjio closed 3 years ago

myshinjio commented 4 years ago

Now i can add text in plotOptions function its will show on click But i can't custom my text inside donut chart.

junedchhipa commented 4 years ago

What have you tried? And what result do you expect?

haizad commented 3 years ago

See Donut Labels https://apexcharts.com/docs/chart-types/pie-donut/

The expected result might be as follows: image

hernanramirez commented 1 year ago

Try:

`let options = { series: [44, 55, 41, 60], labels: ["Transport", "Shopping", "Energy use", "Food"], chart: { type: 'donut', }, plotOptions: { pie: { donut: { labels: { show: true, total: { show: true, label: '', formatter: () => 'Text you want' } } } } } };

const chart = new ApexCharts(document.querySelector("#chart"), options); chart.render();`

chhavientrar commented 1 year ago

thanks