Display percentage bar in Lens

Hello everyone,

I have a question and I want to know if this is possible. I have a lens visualization I want to display on the vertical axis beside the what is currently is in left, a percentage bar also on vertical axis in right of the ghraph, but I want to do that without a new layer.

Is this possible?

Thank you,

Hi @AlexM566

I may have not fully understood the request (a quick mockup even with paint may help here), but if you define a second dimension on the vertical axis, you can then use a Formula to compute a percentage value (with the percentage formatter) and assign the right axis to that.
Have you tried already this route?

Hello @Marco_Liberati ,

Thank you for the quick response :smiley:
Here it is the image:

So what I currently have is number 1 from the image and what I want to add is number 2, meaning the percentage bar, so I want this to be an extra beside what already it is at left ( number1).

I tried to add a second dimensions on the vertical axis but it will double the values, and when i filter out the values because the values are the same I will have no graph :frowning:


I do not think that is possible yet.
But how would you define the percentage reference in the second axis there?

I mean the same value has to be considered as both absolute and relative (percentage) .
You need to compute the percentage against some reference value there (100% of what?)?

The only "hack" I can think of, is to define a second layer as "line chart", se the color of it to something like transparent (you can track the transparency issue here: [Lens] Transparency option on series color · Issue #112839 · elastic/kibana · GitHub ) and define a formula to compute the percentage value (with the percent formatter). Without the transparency color feature you may see some overlapping between the two series (see the white dot on the second bar):

Anyway I've open an issue to discuss the idea: [Lens] Ability to define multiple axis for the same series · Issue #116619 · elastic/kibana · GitHub

I'm not 100% sure of the feasibility but let's see if any interesting proposal comes up : you can track it for future developments.

1 Like

Thank you @Marco_Liberati .

I will use this "hack" and thank you for opening the issue on Git, I will follow this.
This is helpful until we have implemented into a future version.

THX! :sunglasses:

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