# How can I build verticalBar chart based on some custom calculation

**URL:** https://discuss.elastic.co/t/how-can-i-build-verticalbar-chart-based-on-some-custom-calculation/276964
**Category:** Kibana
**Created:** [June 24, 2021, 5:05pm UTC](https://discuss.elastic.co/t/how-can-i-build-verticalbar-chart-based-on-some-custom-calculation/276964 "2021-06-24T17:05:29Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![vivu007x](https://avatars.discourse-cdn.com/v4/letter/v/8dc957/32.png) [@vivu007x](https://discuss.elastic.co/u/vivu007x)
#### Post date: [June 25, 2021, 11:08pm UTC](https://discuss.elastic.co/t/how-can-i-build-verticalbar-chart-based-on-some-custom-calculation/276964/3 "2021-06-25T23:08:55Z")

</div>

Thanks Wylie.

I am going with the TSVB option by following the initial steps mentioned in [Filter ratio in TSVB](https://discuss.elastic.co/t/filter-ratio-in-tsvb/244842).

I am trying to perform a sum operation on one of the fields but I do not see that field as an option. I used python to create mapping and later dumping the data using the API.

```auto
 "mappings": {
            "properties": {
                "timestamp": {
                    "type": "date"
                },
                "status": {
                    "type": "text",
                    "fields": {
                        "raw": {
                            "type": "keyword"
                        }
                    }
                },
                "service": {
                    "type": "text",
                    "fields": {
                        "raw": {
                            "type": "keyword"
                        }
                    }
                }
            }
        }

```

I can only see epoch\_time in the dropdown. Is it because that's the only integer field? How would I make a sum aggregation on a string field like 'service'. Is my mapping correct?

 ![Screen Shot 2021-06-25 at 4.05.15 PM](https://us1.discourse-cdn.com/elastic/original/3X/5/d/5d7c5fa2be6b8b88cda2315292af82a18d2d05ef.png)

---

_[View the full topic](https://discuss.elastic.co/t/how-can-i-build-verticalbar-chart-based-on-some-custom-calculation/276964)._
