# Kibana bar chart help

**URL:** <https://discuss.elastic.co/t/kibana-bar-chart-help/39414>\
**Category:** Kibana\
**Created:** [January 18, 2016, 2:40am UTC](https://discuss.elastic.co/t/kibana-bar-chart-help/39414 "2016-01-18T02:40:28Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![thinkdffrnt](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@thinkdffrnt](https://discuss.elastic.co/u/thinkdffrnt)\
**Post date:** [January 18, 2016, 2:40am UTC](https://discuss.elastic.co/t/kibana-bar-chart-help/39414/1 "2016-01-18T02:40:29Z")

</div>

I'm using Kibana 4.1.2. I want to create a bar chart with the below details:  
Manager name on x-axis and teams under him with unit test coverage.  
I'm a new bie and facing trouble in creating bar chart.

I have the below filter  
a filter in past 1 week sonarCreatedOn: [now-7d TO now]

Sample data:

```auto
{
  "took": 8,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 4,
    "max_score": 1,
    "hits": [
      {
        "_index": "test-v1.0",
        "_type": "sonar",
        "_id": "AVJSMKQBpSv9QsmAakgk",
        "_score": 1,
        "_source": {
          "sonarCreatedOn": "2016-01-15T04:19:59.000-0700",
          "teamName": "Team 1",
          "managerName": "Manager 1",
          "directorName": "Director 1",
          "testCoverage": 49.5
        }
      },
      {
        "_index": "test-v1.0",
        "_type": "sonar",
        "_id": "BVJSMKQBpSv9QsmAakgk",
        "_score": 1,
        "_source": {
          "sonarCreatedOn": "2016-01-15T04:19:59.000-0700",
          "teamName": "Team 2",
          "managerName": "Manager 1",
          "directorName": "Director 1",
          "testCoverage": 10
        }
      },
      {
        "_index": "test-v1.0",
        "_type": "sonar",
        "_id": "BVJSMKQBpSv9QsmAakgk",
        "_score": 1,
        "_source": {
          "sonarCreatedOn": "2016-01-13T04:19:59.000-0700",
          "teamName": "Team 3",
          "managerName": "Manager 2",
          "directorName": "Director 1",
          "testCoverage": 70.4
        }
      },
      {
        "_index": "test-v1.0",
        "_type": "sonar",
        "_id": "BVJSMKQBpSv9QsmAakgk",
        "_score": 1,
        "_source": {
          "sonarCreatedOn": "2016-01-12T04:19:59.000-0700",
          "teamName": "Team 4",
          "managerName": "Manager 3",
          "directorName": "Director 2",
          "testCoverage": 0.2
        }
      }
    ]
  }
}

```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 18, 2016, 2:44am UTC](https://discuss.elastic.co/t/kibana-bar-chart-help/39414/2 "2016-01-18T02:44:27Z")

</div>

So you want `managerName` on X and `teamName` on Y, with a bar value for `testCoverage`?

---

<div class="post-metadata">

**Author:** ![thinkdffrnt](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@thinkdffrnt](https://discuss.elastic.co/u/thinkdffrnt)\
**Post date:** [January 18, 2016, 2:50am UTC](https://discuss.elastic.co/t/kibana-bar-chart-help/39414/3 "2016-01-18T02:50:19Z")

</div>

Yes, and I wanted an consolidated manager name, for example Manger 1 on x-axis and two bars against that name, that is team 1 and team 2

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 18, 2016, 3:10am UTC](https://discuss.elastic.co/t/kibana-bar-chart-help/39414/4 "2016-01-18T03:10:29Z")

</div>

This isn't exactly as I said before but it should work.

Create a bar chart and then change the default count value for Y axis to max for the `testCoverage`, then on the X axis split the charts based on`managerName` and finally use a terms sub-agg on `teamName`.

---

<div class="post-metadata">

**Author:** ![thinkdffrnt](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@thinkdffrnt](https://discuss.elastic.co/u/thinkdffrnt)\
**Post date:** [January 18, 2016, 3:29am UTC](https://discuss.elastic.co/t/kibana-bar-chart-help/39414/5 "2016-01-18T03:29:00Z")

</div>

Thank you warkolm, that worked for me, is there a way that I can combine the manager names?  
Not all teams have coverage every week unless they do a release.\>

---

<div class="post-metadata">

**Author:** ![thinkdffrnt](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@thinkdffrnt](https://discuss.elastic.co/u/thinkdffrnt)\
**Post date:** [January 18, 2016, 3:30am UTC](https://discuss.elastic.co/t/kibana-bar-chart-help/39414/6 "2016-01-18T03:30:41Z")

</div>

Oh I got it this time. My bad. Thanks a lot.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 18, 2016, 3:32am UTC](https://discuss.elastic.co/t/kibana-bar-chart-help/39414/7 "2016-01-18T03:32:17Z")

</div>

How did you do it?

---

<div class="post-metadata">

**Author:** ![thinkdffrnt](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@thinkdffrnt](https://discuss.elastic.co/u/thinkdffrnt)\
**Post date:** [January 18, 2016, 3:36am UTC](https://discuss.elastic.co/t/kibana-bar-chart-help/39414/8 "2016-01-18T03:36:36Z")

</div>

When I used the sub-agg on teamName, earlier I used Split chart, changed to Split bars. Worked for me.  
Attaching a screenshot. Can't show the manager and team names, sorry!

 ![](https://us1.discourse-cdn.com/elastic/original/2X/c/cbca546fd044e1bea63c6bb3fd7b2f3225f61a0a.png)

The only issue is that it doesn't show the teams which has 0 coverage.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 18, 2016, 3:43am UTC](https://discuss.elastic.co/t/kibana-bar-chart-help/39414/9 "2016-01-18T03:43:04Z")

</div>

Argh, that was my fault, I meant split bar not split chart!

---

<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:** [July 6, 2017, 2:04pm UTC](https://discuss.elastic.co/t/kibana-bar-chart-help/39414/10 "2017-07-06T14:04:48Z")

</div>


