# Formatnumber "0.000%" in PIE

**URL:** <https://discuss.elastic.co/t/formatnumber-0-000-in-pie/248673>\
**Category:** Kibana\
**Tags:** canvas\
**Created:** [September 15, 2020, 12:34pm UTC](https://discuss.elastic.co/t/formatnumber-0-000-in-pie/248673 "2020-09-15T12:34:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![francieliton\_araujo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/francieliton_araujo/32/47771_2.png) [@francieliton\_araujo](https://discuss.elastic.co/u/francieliton_araujo)\
**Post date:** [September 15, 2020, 12:34pm UTC](https://discuss.elastic.co/t/formatnumber-0-000-in-pie/248673/1 "2020-09-15T12:34:32Z")

</div>

I created a pie view however as the value is very close to 100 percent, it doesn't really show the result as it rounds to 100 as follows in the image ![pie](https://us1.discourse-cdn.com/elastic/original/3X/b/7/b7f93d0815d75213655ee9bda4df0be51140cbe2.png)  
287/5000

if you look you will see that in the graph it shows the result was not 100 percent Normalized. Well I would like to make it show the real value even if it has to have many decimal places.  
another thing would like the percentage to be 100% not below the name, but beside it.

Expession Editor

```auto
filters
| essql 
  query="SELECT 
case
when sum(segrelatorio) is null then 0 
else ROUND(sum(segrelatorio),9) end as tempo,severidade
FROM 
\"YYYYYY*\"
 WHERE
-- ky != 'icmpping'
 grupo.name = 'XXXXX'
AND severidade != 'Average'

GROUP BY severidade
ORDER BY severidade"
| pointseries color="severidade" size="tempo"
| pie hole=0 labels=true legend=false labelRadius=100 palette={palette "#ff0000" "#f2bc33" "#3f9939" "#ca5f35" gradient=false}
| render 
  css=".pieLabel:nth-child(3) {
margin: 40px 0px 0px 120px;
}
.pieLabel:nth-child(4) {
margin: 70px 0px 0px 110px;
}
.pieLabel:nth-child(5) {
margin: -110px 0px 0px 130px;
}
.pieLabel:nth-child(6) {
margin: 130px 0px 0px 120px;
}
.pieLabel:nth-child(8) {
margin: 130px 0px 0px 130px;
}
" containerStyle={containerStyle overflow="visible"}

```

---

<div class="post-metadata">

**Author:** ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)\
**Post date:** [September 16, 2020, 8:47am UTC](https://discuss.elastic.co/t/formatnumber-0-000-in-pie/248673/2 "2020-09-16T08:47:58Z")

</div>

Hi @francieliton_araujo, unfortunately the Canvas Pie Chart percentage numbers on labels cannot be customized. A workaround I found is to generate your own legend using the markdown element.

For the Kibana Flights data sample, a pie chart by carrier would have this appearance:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/d/bd185005e651e17c0ca420bd2d417f46a9c1c5cb.png)

Using the following data SQL:

```sql
  SELECT
round(count(ALL CASE WHEN "Carrier" = 'ES-Air' THEN 1 ELSE NULL END)/(count(1) * 1.0)*100,3) as esair,
round(count(ALL CASE WHEN "Carrier" = 'Kibana Airlines' THEN 1 ELSE NULL END)/(count(1) * 1.0)*100,3) as kibana,
round(count(ALL CASE WHEN "Carrier" = 'Logstash Airways' THEN 1 ELSE NULL END)/(count(1) * 1.0)*100,3) as logstash,
round(count(ALL CASE WHEN "Carrier" = 'JetBeats' THEN 1 ELSE NULL END)/(count(1) * 1.0)*100,3) as jetbeats
FROM "kibana_sample_data_flights"

```

And the following markdown and css to tweak the labels for the colors:

```markdown
{{#each rows}}
### Kibana Airlines: {{kibana}}%
### ES-Air: **{{esair}}%**
### Logstash Airways: **{{logstash}}%**
### JetBeats: **{{jetbeats}}%**
{{/each}}

```

```css
.canvasRenderEl h3:nth-child(1) { color: #01a4a4;}
.canvasRenderEl h3:nth-child(2) { color: #616161;}
.canvasRenderEl h3:nth-child(3) { color: #cc6666;}
.canvasRenderEl h3:nth-child(4) { color: #d0d102;}

```

Hope it helps!

---

<div class="post-metadata">

**Author:** ![francieliton\_araujo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/francieliton_araujo/32/47771_2.png) [@francieliton\_araujo](https://discuss.elastic.co/u/francieliton_araujo)\
**Post date:** [September 22, 2020, 11:28am UTC](https://discuss.elastic.co/t/formatnumber-0-000-in-pie/248673/3 "2020-09-22T11:28:46Z")

</div>

> [@jsanz](#):
>
> `ALL`

Thank you very much solved my problem using an alternative output, sorry for the delay in responding, but I need to test

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 20, 2020, 11:28am UTC](https://discuss.elastic.co/t/formatnumber-0-000-in-pie/248673/4 "2020-10-20T11:28:59Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
