# How to remove columns from a bar chart which have no data

**URL:** https://discuss.elastic.co/t/how-to-remove-columns-from-a-bar-chart-which-have-no-data/49923
**Category:** Kibana
**Created:** [May 12, 2016, 4:49pm UTC](https://discuss.elastic.co/t/how-to-remove-columns-from-a-bar-chart-which-have-no-data/49923 "2016-05-12T16:49:43Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Ken\_Ivon](https://avatars.discourse-cdn.com/v4/letter/k/7c8e57/32.png) [@Ken\_Ivon](https://discuss.elastic.co/u/Ken_Ivon)
#### Post date: [May 12, 2016, 4:49pm UTC](https://discuss.elastic.co/t/how-to-remove-columns-from-a-bar-chart-which-have-no-data/49923/1 "2016-05-12T16:49:43Z")

</div>

Continuing the discussion from [Absence of some X.AXIS values in Bar chart or line chart](https://discuss.elastic.co/t/absence-of-some-x-axis-values-in-bar-chart-or-line-chart/49624):

I have the same basic question. I am also new fairly new to Kibana. I am using version 4.4.2.

My configuration is :  
y-axis sum of technique\_count  
x-axis Terms aggregation on ne\_type.raw order by y-axis metric  
split chart on columns, Terms aggregation on ne\_ip.raw order by y-axis metric  
split bars Terms aggregation on technique.raw order by y-axis metric

This gives me basically what I want, which is IP address by NE\_TYPE by discovery technique. However, the way I have it configured, Kibana is doing a cartesian product of ne\_ip and ne\_type, so If I have 1000 ne\_ip addresses and 20 ne\_types, i am getting 20 columns per IP address. In the actual data, one IP address will not be related to more than 2 ne\_types, so in such an instance I get 20 columns for one IP address, but only 1 or 2 of those columns will actually have counts greater than zero and the other 18 will have zero counts. This means most of the columns that will fit on a viewable graph will be meaningless so I would like to remove those zero count columns from the visualization.

---

<div class="post-metadata">

### Author: ![LeeDr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leedr/32/9289_2.png) [@LeeDr](https://discuss.elastic.co/u/LeeDr)
#### Post date: [May 16, 2016, 6:56pm UTC](https://discuss.elastic.co/t/how-to-remove-columns-from-a-bar-chart-which-have-no-data/49923/2 "2016-05-16T18:56:39Z")

</div>

Hi Ken,

Are you mostly trying to get the data table? Or the chart?

I'm trying to test a similar scenario with my test data but I don't think it's similar enough. Can you post a screenshot?

Thanks,  
Lee

---

<div class="post-metadata">

### Author: ![drivinivon](https://avatars.discourse-cdn.com/v4/letter/d/bb73d2/32.png) [@drivinivon](https://discuss.elastic.co/u/drivinivon)
#### Post date: [May 17, 2016, 12:01pm UTC](https://discuss.elastic.co/t/how-to-remove-columns-from-a-bar-chart-which-have-no-data/49923/3 "2016-05-17T12:01:50Z")

</div>

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

Hopefully that is readable.

Here is a sample data set if that helps (the IPs have been changed to protect the innocent). The real data set is 41,000+ lines.

ne\_ip,src\_type,name,ne\_type,alt\_name,capability\_code,technique,technique\_count,source,Disposition  
1.99.254.99,IP,MME\_1.99.254.99,MME,,,mme-s1ap-1,159084916,MX-TOL-M1-CEM-TSA\_PS-2.20m\_pcaps,  
1.99.254.99,IP,MME\_1.99.254.99,MME,,,mme-s1ap-2,494383,MX-TOL-M1-CEM-TSA\_PS-2.20m\_pcaps,  
1.99.254.99,IP,MME\_1.99.254.99,MME,,,mme-s1ap-3,160923567,MX-TOL-M1-CEM-TSA\_PS-2.20m\_pcaps,  
1.99.254.99,IP,MME\_1.99.254.99,MME,,,mme-s1ap-4,1203144,MX-TOL-M1-CEM-TSA\_PS-2.20m\_pcaps,  
1.99.254.99,IP,MME\_1.99.254.99,MME,,,mme-s1ap-5,17027,MX-TOL-M1-CEM-TSA\_PS-2.20m\_pcaps,  
1.99.254.99,IP,MME\_1.99.254.99,MME,,,mme-s1ap-6,15897,MX-TOL-M1-CEM-TSA\_PS-2.20m\_pcaps,  
1.99.254.99,IP,MME\_1.99.254.99,MME,,,mme-s1ap-7,3336794,MX-TOL-M1-CEM-TSA\_PS-2.20m\_pcaps,  
1.99.254.99,IP,MME\_1.99.254.99,MME,,,mme-s1ap-8,68,MX-TOL-M1-CEM-TSA\_PS-2.20m\_pcaps,  
1.99.254.99,IP,eNodeB\_1.99.254.99,eNodeB,,,enodeb-s1ap-1,68,MX-TOL-M1-CEM-TSA\_PS-2.20m\_pcaps,  
1.99.254.99,IP,eNodeB\_1.99.254.99,eNodeB,,,enodeb-s1ap-2,494441,MX-TOL-M1-CEM-TSA\_PS-2.20m\_pcaps,  
1.99.254.99,IP,eNodeB\_1.99.254.99,eNodeB,,,enodeb-s1ap-3,9069570,MX-TOL-M1-CEM-TSA\_PS-2.20m\_pcaps,  
1.99.254.99,IP,eNodeB\_1.99.254.99,eNodeB,,,enodeb-s1ap-4,1209516,MX-TOL-M1-CEM-TSA\_PS-2.20m\_pcaps,  
1.99.254.99,IP,eNodeB\_1.99.254.99,eNodeB,,,enodeb-s1ap-5,17003,MX-TOL-M1-CEM-TSA\_PS-2.20m\_pcaps,  
1.99.254.99,IP,eNodeB\_1.99.254.99,eNodeB,,,enodeb-s1ap-6,15871,MX-TOL-M1-CEM-TSA\_PS-2.20m\_pcaps,  
1.99.254.99,IP,eNodeB\_1.99.254.99,eNodeB,,,enodeb-s1ap-7,3331547,MX-TOL-M1-CEM-TSA\_PS-2.20m\_pcaps,  
1.99.254.99,IP,eNodeB\_1.99.254.99,eNodeB,,,enodeb-s1ap-8,74,MX-TOL-M1-CEM-TSA\_PS-2.20m\_pcaps,  
8.99.168.191,IP,GGSN\_8.99.168.191,GGSN,,,ggsn-gtp-1,2,MX-TOL-M1-CEM-TSA\_PS-2.20m\_pcaps,  
8.99.168.191,IP,GGSN\_8.99.168.191,GGSN,,,ggsn-gtp-2,2,MX-TOL-M1-CEM-TSA\_PS-2.20m\_pcaps,  
6.19.17.88,IP,MSC\_6.19.17.88,MSC,,,msc-gsm\_map-1,2109,MX-MEX-M1-CEM-TSA\_PS-2-15Min-02242016\_pcaps,  
6.19.17.88,IP,MSC\_6.19.17.88,MSC,,,msc-gsm\_map-2,2600,MX-MEX-M1-CEM-TSA\_PS-2-15Min-02242016\_pcaps,  
19.19.22.90,IP,GGSN\_19.19.22.90,GGSN,,,ggsn-gtp-1,215,MX-TOL-M1-CEM-TSA\_PS-2.20m\_pcaps,  
19.19.22.90,IP,GGSN\_19.19.22.90,GGSN,,,ggsn-gtp-2,215,MX-TOL-M1-CEM-TSA\_PS-2.20m\_pcaps,  
19.19.22.90,IP,SGW\_19.19.22.90,SGW,,,sgw-gtpv2-1,1,lte.0223.gtpc\_pcaps,  
19.19.22.90,IP,SGW\_19.19.22.90,SGW,,,sgw-gtpv2-1,2,MX-MEX-M1-CEM-TAA\_PS-1\_12102015\_10GB\_pcaps,  
19.203.33.14,IP,MME\_19.203.33.14,MME,,,mme-gtpv2-1,45158,MX-TOL-M1-CEM-TSA\_PS-2.20m\_pcaps,  
19.203.33.14,IP,SGSN\_19.203.33.14,SGSN,,,sgsn-gtp-1,60687,MX-TOL-M1-CEM-TSA\_PS-2.20m\_pcaps,  
19.203.33.14,IP,SGSN\_19.203.33.14,SGSN,,,sgsn-gtp-2,60688,MX-TOL-M1-CEM-TSA\_PS-2.20m\_pcaps,

The lines above for the 1.99.254.99 IP is all the data in the file for the first IP shown in the screen shot. It has only MME and eNodeB ne\_type records associated with it, but in the screen shot you can see columns for all 6 different ne\_types that are found in the data set. I haven't tried the above data set myself yet, but I am assuming the issue is not a data size issue. I included some records for each of the 6 ne\_types found in the real data set. Hopefully it will reproduce the issue.

In response to your question, I am mostly trying to get the bar chart to not show the ip/ne combinations that have no data associated with them.

---

<div class="post-metadata">

### Author: ![drivinivon](https://avatars.discourse-cdn.com/v4/letter/d/bb73d2/32.png) [@drivinivon](https://discuss.elastic.co/u/drivinivon)
#### Post date: [May 17, 2016, 12:04pm UTC](https://discuss.elastic.co/t/how-to-remove-columns-from-a-bar-chart-which-have-no-data/49923/4 "2016-05-17T12:04:26Z")

</div>

Also, in case it matters, the IP addresses are stored in elasticsearch as strings, not IP addresses. All the values are strings except for technique\_count, which is an integer.

---

<div class="post-metadata">

### Author: ![drivinivon](https://avatars.discourse-cdn.com/v4/letter/d/bb73d2/32.png) [@drivinivon](https://discuss.elastic.co/u/drivinivon)
#### Post date: [May 17, 2016, 12:19pm UTC](https://discuss.elastic.co/t/how-to-remove-columns-from-a-bar-chart-which-have-no-data/49923/5 "2016-05-17T12:19:48Z")

</div>

Here is the screen shot using the test data set I provided.

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

For the first IP shown, there is only data for the first 2 ne\_types, so I would like to remove the additional 4 ne\_type columns so that I can display more of the relevant data. I would want to do the same for any ne\_type columns that have no corresponding records in the data set.

---

<div class="post-metadata">

### Author: ![LeeDr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leedr/32/9289_2.png) [@LeeDr](https://discuss.elastic.co/u/LeeDr)
#### Post date: [May 19, 2016, 1:04pm UTC](https://discuss.elastic.co/t/how-to-remove-columns-from-a-bar-chart-which-have-no-data/49923/6 "2016-05-19T13:04:18Z")

</div>

Hi Ken,  
I'm still trying to help you on this. I have your sample data loaded but haven't found a solution yet and I'm at a conference a few days this week.

Regards,  
Lee

---

<div class="post-metadata">

### Author: ![drivinivon](https://avatars.discourse-cdn.com/v4/letter/d/bb73d2/32.png) [@drivinivon](https://discuss.elastic.co/u/drivinivon)
#### Post date: [June 6, 2016, 12:40pm UTC](https://discuss.elastic.co/t/how-to-remove-columns-from-a-bar-chart-which-have-no-data/49923/7 "2016-06-06T12:40:38Z")

</div>

Hi Lee,  
Have you had a chance to research this any further?

Thanks,  
Ken

---

<div class="post-metadata">

### Author: ![LeeDr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leedr/32/9289_2.png) [@LeeDr](https://discuss.elastic.co/u/LeeDr)
#### Post date: [June 6, 2016, 1:42pm UTC](https://discuss.elastic.co/t/how-to-remove-columns-from-a-bar-chart-which-have-no-data/49923/8 "2016-06-06T13:42:59Z")

</div>

Hi Ken,  
I spent some more time on it but didn't find a solution. I'll ask around and see if I can find some help.

Regards,  
Lee

---

<div class="post-metadata">

### Author: ![LeeDr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leedr/32/9289_2.png) [@LeeDr](https://discuss.elastic.co/u/LeeDr)
#### Post date: [June 6, 2016, 2:11pm UTC](https://discuss.elastic.co/t/how-to-remove-columns-from-a-bar-chart-which-have-no-data/49923/9 "2016-06-06T14:11:54Z")

</div>

Hi Ken,  
Someone else suggested going to the Advanced link in your aggregation and add `{"min_doc_count" : 1}`. Can you give that a try?

Thanks,  
Lee

---

<div class="post-metadata">

### Author: ![Ken\_Ivon](https://avatars.discourse-cdn.com/v4/letter/k/7c8e57/32.png) [@Ken\_Ivon](https://discuss.elastic.co/u/Ken_Ivon)
#### Post date: [June 6, 2016, 6:07pm UTC](https://discuss.elastic.co/t/how-to-remove-columns-from-a-bar-chart-which-have-no-data/49923/10 "2016-06-06T18:07:12Z")

</div>

I added {"min\_doc\_count" : 1} to the JSON input section for the x-axis bucket, but it made no difference. I then added it to Split Chart and tried again, and then to Split Bars, but I see no change in my visualization at any point.

Thanks,  
Ken

---

<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, 1:51pm UTC](https://discuss.elastic.co/t/how-to-remove-columns-from-a-bar-chart-which-have-no-data/49923/11 "2017-07-06T13:51:27Z")

</div>


