# How to create vertical bar graph with sum of \[number\] per day, and break the bar with count of "fails"

**URL:** <https://discuss.elastic.co/t/how-to-create-vertical-bar-graph-with-sum-of-number-per-day-and-break-the-bar-with-count-of-fails/157374>\
**Category:** Kibana\
**Created:** [November 19, 2018, 2:04pm UTC](https://discuss.elastic.co/t/how-to-create-vertical-bar-graph-with-sum-of-number-per-day-and-break-the-bar-with-count-of-fails/157374 "2018-11-19T14:04:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![guibarati](https://avatars.discourse-cdn.com/v4/letter/g/848f3c/32.png) [@guibarati](https://discuss.elastic.co/u/guibarati)\
**Post date:** [November 19, 2018, 2:04pm UTC](https://discuss.elastic.co/t/how-to-create-vertical-bar-graph-with-sum-of-number-per-day-and-break-the-bar-with-count-of-fails/157374/1 "2018-11-19T14:04:30Z")

</div>

Hi, I have a database with logs and each log has a "repeat" field. I'd like to create a vertical graph that has one bar for each day. the bar metric will be the sum of "repeats" of all logs, and I want to break the bar with another color for the number of fails.

Can someone point me on the direction of how to build this visualization?

Thank you,

---

<div class="post-metadata">

**Author:** ![thomasneirynck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomasneirynck/32/23313_2.png) [@thomasneirynck](https://discuss.elastic.co/u/thomasneirynck)\
**Post date:** [November 19, 2018, 8:10pm UTC](https://discuss.elastic.co/t/how-to-create-vertical-bar-graph-with-sum-of-number-per-day-and-break-the-bar-with-count-of-fails/157374/2 "2018-11-19T20:10:40Z")

</div>

hi @guibarati,

For the first part:

In any case, start with creating a date-time aggregation and set the interval to 1-day. For a metric, select  
sum of repeat-field.

For the second part, I guess it depends: Where does the "number of fails" come from?

---

<div class="post-metadata">

**Author:** ![guibarati](https://avatars.discourse-cdn.com/v4/letter/g/848f3c/32.png) [@guibarati](https://discuss.elastic.co/u/guibarati)\
**Post date:** [November 20, 2018, 4:28pm UTC](https://discuss.elastic.co/t/how-to-create-vertical-bar-graph-with-sum-of-number-per-day-and-break-the-bar-with-count-of-fails/157374/3 "2018-11-20T16:28:40Z")

</div>

Hi @thomasneirynck,

So, the fail is one of two results that each entry has.  
For example there are 1000 logins, and 900 of them will have the field:content =\> result:pass. And 100 of them will have result:fail.  
So I was looking into having the bar show 1000 logins and on the same bar show with a different color the number of logins with result:fail.

---

<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:** [December 18, 2018, 4:28pm UTC](https://discuss.elastic.co/t/how-to-create-vertical-bar-graph-with-sum-of-number-per-day-and-break-the-bar-with-count-of-fails/157374/4 "2018-12-18T16:28:42Z")

</div>

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