Is it possible to display a value for a threshold line on a vertical bar graph?

Hi Elastic Community,

The question is pretty much what the title says. I am looking to be able to display the value of a threshold line in a vertical bar chart on the chart in some way. I have the line configured and displaying, but can't find a way to show the value of the line on the chart as the scale is large seeing exact values is difficult based on the axis value is near impossible.

Any help would be appreciated - thanks!

we added reference lines to Lens in 7.16 which can somewhat do can display a label. are you trying to display the dynamic value as a label on a vertical threshold?

for example in this screenshot do you want to see the value of the 95th percentile in the label? Something else?

Sort of, but not really. I'm trying to display the value of the red line in this screenshot:


I configured that threshold line via the panel settings here, and would like to display the value of the line on the chart.

if the number is a static number and you are on 7.16 or later then the Lens visualization editor can display it. you're right though - this is not supported in the aggregation based visualizations

Thanks for the quick response! I'm not seeing the options you have there, so I'm guessing I'm not on 7.16. or I'm looking in the wrong spot. I don't see a way to add a static value to the visualization in Lens (I have not really used Lens before, so this could very well be user error). How did you get to the screenshot above?

I only appear to be able to add fields from the indexed records. This is what I'm seeing:


Hi @vector_prime

you have to click on the + button below the Reset layer add a new Reference layer.
In such layer you can add what @ghudgins was showing:

Thanks Marco! I don't have that option for a reference line when I click the + button. It looks to just add another graph layer (bar, area, etc) based on my current index (which looks like I can change it). I'm betting this is due to versioning, as I just double checked and while supposedly we are on 7.16, Kibana is reporting v7.6 from the UI. :-/

I'll have to figure out why Kibana is reporting the wrong version (or is actually the wrong version since I'm not seeing what you are) and then try this again.

Thank you both for the quick replies!

Ok - figured out the Kibana issue (docker volumes are fun) and we are now running 7.16.3 Kibana in addition to the rest of the Elastic stack, which leads me to what I hope is my final question.

Is there a way to display the values inside or on top of the bars in a vertical bar chart in Lens? You can do this with a non-Lens vertical bar chart, so hopefully I'm just missing the option in Lens.

No, that is not yet possible in Lens.

adding this thread to Render bar labels outside the bar · Issue #1277 · elastic/elastic-charts · GitHub

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