Fix x-axis in Kibana 7.13.2

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.

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

1 Like

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
1 Like

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!!

You can create a runtime field to do type conversion.

i tried to ingest pipeline but getting error like

"type" : "number_format_exception", "reason" : "for input string: "hour""

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

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.

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


Thanks the conversion is done successfully :grinning:

1 Like

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

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

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