# How to display total count inside donut type pie chart

**URL:** <https://community.grafana.com/t/how-to-display-total-count-inside-donut-type-pie-chart/19116>\
**Category:** Time Series Panel\
**Tags:** mysql\
**Created:** [July 9, 2019, 9:36am UTC](https://community.grafana.com/t/how-to-display-total-count-inside-donut-type-pie-chart/19116 "2019-07-09T09:36:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sathyals](https://avatars.discourse-cdn.com/v4/letter/s/c68b51/32.png) [@sathyals](https://community.grafana.com/u/sathyals)\
**Post date:** [July 9, 2019, 9:36am UTC](https://community.grafana.com/t/how-to-display-total-count-inside-donut-type-pie-chart/19116/1 "2019-07-09T09:36:14Z")

</div>

How to display total count inside donut type pie chart.

 ![image](https://us1.discourse-cdn.com/grafana/original/2X/a/ad3896b24cff79f2e3d46a83e62150a9e363a7c1.png)

---

<div class="post-metadata">

**Author:** ![romanbogza](https://avatars.discourse-cdn.com/v4/letter/r/9de0a6/32.png) [@romanbogza](https://community.grafana.com/u/romanbogza)\
**Post date:** [September 28, 2021, 7:27pm UTC](https://community.grafana.com/t/how-to-display-total-count-inside-donut-type-pie-chart/19116/2 "2021-09-28T19:27:48Z")

</div>

did you get this figured out? Trying to solve the same issue.

---

<div class="post-metadata">

**Author:** ![lochanie1987](https://avatars.discourse-cdn.com/v4/letter/l/f04885/32.png) [@lochanie1987](https://community.grafana.com/u/lochanie1987)\
**Post date:** [October 1, 2021, 4:53pm UTC](https://community.grafana.com/t/how-to-display-total-count-inside-donut-type-pie-chart/19116/3 "2021-10-01T16:53:05Z")

</div>

Hi,  
Do you resolve this issue?? I am also finding away to do this?

---

<div class="post-metadata">

**Author:** ![carlocea9](https://avatars.discourse-cdn.com/v4/letter/c/aeb1de/32.png) [@carlocea9](https://community.grafana.com/u/carlocea9)\
**Post date:** [August 15, 2025, 9:58am UTC](https://community.grafana.com/t/how-to-display-total-count-inside-donut-type-pie-chart/19116/4 "2025-08-15T09:58:55Z")

</div>

It’s not a feature - help upvote in GitHub [Ability to put value inside Donut (Pie) chart · Issue #93699 · grafana/grafana](https://github.com/grafana/grafana/issues/93699)

---

<div class="post-metadata">

**Author:** ![infofcc3](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/infofcc3/32/51248_2.png) [@infofcc3](https://community.grafana.com/u/infofcc3)\
**Post date:** [August 16, 2025, 12:20pm UTC](https://community.grafana.com/t/how-to-display-total-count-inside-donut-type-pie-chart/19116/5 "2025-08-16T12:20:29Z")

</div>

Hello @sathyals ,  
After analyzing the issue, I believe I have identified the underlying problem. Please find below the recommended steps that may help resolve it

**Step 1.** Create table and Insert dummy data

```auto
CREATE TABLE build_status (
    id SERIAL PRIMARY KEY,
    status VARCHAR(10) -- 'SUCCESS' or 'FAILURE'
);

-- Insert dummy data
INSERT INTO build_status (status) VALUES
('SUCCESS'), ('SUCCESS'), ('FAILURE'), ('SUCCESS'), ('FAILURE'),
('SUCCESS'), ('SUCCESS'), ('FAILURE'), ('SUCCESS'), ('SUCCESS');

```

**Step 2.** Integrate PostgreSQL with Grafana

Ensure that your PostgreSQL database is added as a data source in Grafana.

**Step 3.** Write a panel query

```auto
SELECT
  status,
  COUNT(*) AS total,
  ROUND((COUNT(*) * 100.0) / (SELECT COUNT(*) FROM build_status), 2) AS percentage
FROM build_status
GROUP BY status;

```

**Step 4.** Configure the panel settings

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/a/e/aef160e11ce810bb4919aabb2b083eb60d38cc0f.png)

Final Output :-

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/f/8/f8771e4ca8fb1ea89ff614fa882c96c98f95c860.png)

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/4/c/4c9263abdb3a9525a9d28f3620fddaddda9a5b83.png)

---

<div class="post-metadata">

**Author:** ![carlocea9](https://avatars.discourse-cdn.com/v4/letter/c/aeb1de/32.png) [@carlocea9](https://community.grafana.com/u/carlocea9)\
**Post date:** [August 16, 2025, 6:20pm UTC](https://community.grafana.com/t/how-to-display-total-count-inside-donut-type-pie-chart/19116/6 "2025-08-16T18:20:42Z")

</div>

@infofcc3 I think he’s after the grand total so 7+3 = 10

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [August 16, 2025, 7:13pm UTC](https://community.grafana.com/t/how-to-display-total-count-inside-donut-type-pie-chart/19116/7 "2025-08-16T19:13:04Z")

</div>

other than the stock pie chart one could use business chart and have more control for an inner donut that shows totals

> **[Examples - Apache ECharts](https://echarts.apache.org/examples/en/editor.html?c=pie-nest)**
>
> Apache ECharts, a powerful, interactive charting and visualization library for browser

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/0/1/01b2154acab1df5dbc07f9618b6a9ac4827a3f2c.jpeg)
