# Fix x-axis in Kibana 7.13.2

**URL:** https://discuss.elastic.co/t/fix-x-axis-in-kibana-7-13-2/277918
**Category:** Kibana
**Created:** [July 6, 2021, 7:13am UTC](https://discuss.elastic.co/t/fix-x-axis-in-kibana-7-13-2/277918 "2021-07-06T07:13:55Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![ANKITA\_SAHA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankita_saha/32/91152_2.png) [@ANKITA\_SAHA](https://discuss.elastic.co/u/ANKITA_SAHA)
#### Post date: [July 6, 2021, 7:13am UTC](https://discuss.elastic.co/t/fix-x-axis-in-kibana-7-13-2/277918/1 "2021-07-06T07:13:55Z")

</div>

Hi i m new to kibana!

I want help in making the x-axis static. I have two columns "no.of errors" and "hours".  
I have no.of errors in y-axis and in x-axis is hours . When i try to filter my data my x-axis gets filtered but i want to keep it as it is.

please help!!!

i use kibana 7.13.2.

---

<div class="post-metadata">

### Author: ![ghudgins](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ghudgins/32/138532_2.png) [@ghudgins](https://discuss.elastic.co/u/ghudgins)
#### Post date: [July 6, 2021, 12:42pm UTC](https://discuss.elastic.co/t/fix-x-axis-in-kibana-7-13-2/277918/2 "2021-07-06T12:42:23Z")

</div>

Are you asking that clicking on a visualization still filters the data but doesn't "zoom in" on the X axis to the value you clicked (an hour in your example)? A screenshot might help, if you don't mind sharing

---

<div class="post-metadata">

### Author: ![ANKITA\_SAHA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankita_saha/32/91152_2.png) [@ANKITA\_SAHA](https://discuss.elastic.co/u/ANKITA_SAHA)
#### Post date: [July 6, 2021, 3:08pm UTC](https://discuss.elastic.co/t/fix-x-axis-in-kibana-7-13-2/277918/3 "2021-07-06T15:08:32Z")

</div>

![image](https://us1.discourse-cdn.com/elastic/original/3X/2/d/2de3494acb771dc12562574b0c5a466a60c33fa8.png)

---

<div class="post-metadata">

### Author: ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)
#### Post date: [July 6, 2021, 3:29pm UTC](https://discuss.elastic.co/t/fix-x-axis-in-kibana-7-13-2/277918/4 "2021-07-06T15:29:03Z")

</div>

In order to get a static X-axis, you can:

- Use the `Filters` function where you define each bar manually
- Use the aggregation-based bar chart (not Lens) with a Histogram function with extended bounds

---

<div class="post-metadata">

### Author: ![ANKITA\_SAHA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankita_saha/32/91152_2.png) [@ANKITA\_SAHA](https://discuss.elastic.co/u/ANKITA_SAHA)
#### Post date: [July 6, 2021, 5:09pm UTC](https://discuss.elastic.co/t/fix-x-axis-in-kibana-7-13-2/277918/5 "2021-07-06T17:09:37Z")

</div>

for histogram i need a number or number\_range but unfortunately i am unable to convert my 'hour' column from string to int.  
If you can tell me a way to convert will be helpful!!

---

<div class="post-metadata">

### Author: ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)
#### Post date: [July 6, 2021, 5:56pm UTC](https://discuss.elastic.co/t/fix-x-axis-in-kibana-7-13-2/277918/6 "2021-07-06T17:56:36Z")

</div>

You can create a runtime field to do type conversion.

---

<div class="post-metadata">

### Author: ![ANKITA\_SAHA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankita_saha/32/91152_2.png) [@ANKITA\_SAHA](https://discuss.elastic.co/u/ANKITA_SAHA)
#### Post date: [July 7, 2021, 7:30am UTC](https://discuss.elastic.co/t/fix-x-axis-in-kibana-7-13-2/277918/8 "2021-07-07T07:30:49Z")

</div>

i tried to ingest pipeline but getting error like

"type" : "number\_format\_exception", "reason" : "for input string: "hour""

---

<div class="post-metadata">

### Author: ![ghudgins](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ghudgins/32/138532_2.png) [@ghudgins](https://discuss.elastic.co/u/ghudgins)
#### Post date: [July 7, 2021, 1:10pm UTC](https://discuss.elastic.co/t/fix-x-axis-in-kibana-7-13-2/277918/9 "2021-07-07T13:10:35Z")

</div>

Check out runtime fields in the Lens UI instead of stack management (it's newer as of 7.13) - [Lens | Kibana Guide [7.13] | Elastic](https://www.elastic.co/guide/en/kibana/current/lens.html#add-fields-in-lens)

You can add a script that converts the field to the appropriate data type. Really, though, if this works for you it's more performant to index the appropriate type up front (runtime fields are slower than indexed fields).

Here's an example that does the opposite of what you're trying to do. The example uses painless which exposes a lot of useful java APIs.

```auto
Long input = doc['event.duration'].value;
String output = Objects.toString(input);

emit(output);

```

---

<div class="post-metadata">

### Author: ![ANKITA\_SAHA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankita_saha/32/91152_2.png) [@ANKITA\_SAHA](https://discuss.elastic.co/u/ANKITA_SAHA)
#### Post date: [July 7, 2021, 5:10pm UTC](https://discuss.elastic.co/t/fix-x-axis-in-kibana-7-13-2/277918/11 "2021-07-07T17:10:48Z")

</div>

Thanks the conversion is done successfully 😀

---

<div class="post-metadata">

### Author: ![ANKITA\_SAHA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankita_saha/32/91152_2.png) [@ANKITA\_SAHA](https://discuss.elastic.co/u/ANKITA_SAHA)
#### Post date: [July 7, 2021, 5:14pm UTC](https://discuss.elastic.co/t/fix-x-axis-in-kibana-7-13-2/277918/12 "2021-07-07T17:14:12Z")

</div>

I tried histogram but same thing its zooming in and not static

---

<div class="post-metadata">

### Author: ![ANKITA\_SAHA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankita_saha/32/91152_2.png) [@ANKITA\_SAHA](https://discuss.elastic.co/u/ANKITA_SAHA)
#### Post date: [July 7, 2021, 5:28pm UTC](https://discuss.elastic.co/t/fix-x-axis-in-kibana-7-13-2/277918/13 "2021-07-07T17:28:04Z")

</div>

![1](https://us1.discourse-cdn.com/elastic/original/3X/b/c/bc1ec51ea34646b40d2de5b71f80326e4a0b56e1.png)  
 ![2](https://us1.discourse-cdn.com/elastic/original/3X/4/d/4d16507b830860738d59ab15b5332c65fb49e421.png)

These are my settings! Here 'new' is the new field containing hours.  
In the main dashboard when i apply filters it gets zoomed again which i dont want. I want all marks of x-axis

---

<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: [August 4, 2021, 5:28pm UTC](https://discuss.elastic.co/t/fix-x-axis-in-kibana-7-13-2/277918/14 "2021-08-04T17:28:45Z")

</div>

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