# Graphing the share of a value over total

**URL:** <https://discuss.elastic.co/t/graphing-the-share-of-a-value-over-total/199440>\
**Category:** Kibana\
**Created:** [September 13, 2019, 1:32pm UTC](https://discuss.elastic.co/t/graphing-the-share-of-a-value-over-total/199440 "2019-09-13T13:32:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![matd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matd/32/9892_2.png) [@matd](https://discuss.elastic.co/u/matd)\
**Post date:** [September 13, 2019, 1:32pm UTC](https://discuss.elastic.co/t/graphing-the-share-of-a-value-over-total/199440/1 "2019-09-13T13:32:18Z")

</div>

Hi folks,

I'm quite new to kibana, and there's something really simple I'd like to do, and can't find the way.

I want to measure the availability of an API over time, so it's simply the percent of successful queries (http 2xx) over the total, along time. Basically something like [this](https://devblogs.microsoft.com/bharry/wp-content/uploads/sites/8/2013/10/0027.image_2D9005F9.png)

How to do it with kibana ?

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [September 13, 2019, 3:02pm UTC](https://discuss.elastic.co/t/graphing-the-share-of-a-value-over-total/199440/2 "2019-09-13T15:02:40Z")

</div>

If you don't already have the api access log data, I'd highly recommend using Heartbeat which basically pings a hostname/api and then displays the data in the Uptime app in Kibana.  
If you already have the data, you can try this:

1. Create an Area chart visualization on the index that you have.
2. Set Count as a metric on the Y axis
3. Set a Date histogram on your time field in the X Axis.
4. Select Split series on the X Axis, with a Filters aggregation.
5. In the field, select the field that has the response (in the sample data it's a string field, so i'm going to treat it like that here too).
6. First filter should be `response.keyword: 2*` (here `response.keyword` is the field with the reponse)
7. Second filter should be `NOT response.keyword: 2*`
8. In the metrics & axes tab of the visualization options. set the Y-axis to Mode: Percentage.

You can change it from chart type: area to line if you want it look exactly like your example.

 ![response%20code](https://us1.discourse-cdn.com/elastic/original/3X/b/0/b0066dbf333916124ece5489767ed95b78bf30fe.png)

---

<div class="post-metadata">

**Author:** ![matd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matd/32/9892_2.png) [@matd](https://discuss.elastic.co/u/matd)\
**Post date:** [September 15, 2019, 12:45pm UTC](https://discuss.elastic.co/t/graphing-the-share-of-a-value-over-total/199440/3 "2019-09-15T12:45:28Z")

</div>

Thanks for your answer.  
I find this convoluted... but ok, I managed to do that. Problem now is with the scale of y axis.  
First, it's not dynamically adjusted to what happens, and with an availability in the 99.5% the labels are just useless ☹

 ![Screenshot%20from%202019-09-15%2014-45-53](https://us1.discourse-cdn.com/elastic/original/3X/5/3/530bac0fa9d194ac62607a4856cbe862d22159e8.png)

---

<div class="post-metadata">

**Author:** ![matd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matd/32/9892_2.png) [@matd](https://discuss.elastic.co/u/matd)\
**Post date:** [September 15, 2019, 1:00pm UTC](https://discuss.elastic.co/t/graphing-the-share-of-a-value-over-total/199440/4 "2019-09-15T13:00:25Z")

</div>

I tried a "metric" display instead (same splitting and all), and ...erm... what the hell does that even mean ?  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/3/03a4bb96fa96e452d341d38106b590aff9370d42.png)

(kibana v6.8.2)

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [September 19, 2019, 1:31pm UTC](https://discuss.elastic.co/t/graphing-the-share-of-a-value-over-total/199440/5 "2019-09-19T13:31:20Z")

</div>

You can change the bounds of the chart to show values up to 110%, makes it way easier to read.

---

<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 17, 2019, 1:31pm UTC](https://discuss.elastic.co/t/graphing-the-share-of-a-value-over-total/199440/6 "2019-10-17T13:31:21Z")

</div>

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