Kibana Lens 7.12 - Mixed Bar/Line Option in Lens to show Daily as Bar and Moving Avg as line

Hi All,

I'm using Kibana to show the count of events for various services received over time. I've been displaying this as a bar chart no problem but would like to also include a moving 7 day average as a line so that the two are comparable on the same chart.

At the moment in Lens I don't seem to be able to do this. Adding the two calculations to the same layer appears to mean they both need to be of the same type (bar or line but not a mix). I tried adding them as two layers, which allowed the 'mixed' chart but resulted in the legend series labels being identical so for a viewer it wouldn't be obvious which was which.

Both Calculations in same layer:

Separate Layers:

Anybody able to let point me in the right direction?


Thanks for the feedback on Lens! You're right that you need to use layers to mix bars & lines. You're also right that the legend is getting cut off, this is something we are working on. Here are my suggestions as one of the Lens developers:

  • You can add a title to the saved visualization, instead of using the legend to explain the visualization. For example your title could be "Event count vs 7 day moving average".

  • Since you are filtering to show only one applicationname, you can delete your "break down by" and the legend will show "Event count" and "7 day moving average". If you have very few application names, you add a separate Lens panel for each applicationname, using the "Clone panel" feature to quickly start each one. This only works if the application names are predictable.

  • You can change the display of your applicationname.keyword field across all of Kibana by editing the field formatter. This might not be what you want, but for example you can truncate the label to only 20 characters, or you can add a Lookup formatter which maps your applications to a human-readable name.

Hi Wylie,

First of all, apologies for taking so long to respond - I've been sidetracked at work with other priorities and this kind of slipped off my radar for a few days.

Secondly, thanks very much indeed for such a quick response - and one that's got some great detail in it.

In my case, we have maybe 25-30 application names already with more being added periodically so creating separate explicit panels for each is probably not going to be the way forward.

I'll take a look into the first and third options and see which works best. I'm not sure I've used the field formatter or lookup formatter before so there'll be some more learning there....!!

Just out of interest, is there any timeline on when the issue with the legends being truncated might be resolved?

Thanks again for the help.

@stevedearl We're starting to discuss these long labels and what we can do, so I can't offer a timeline but I can say that this is getting attention. In the long term we're looking at how we can let you easily create 30 panels using similar but different data, but that's not near term.

Here are the issues where we're discussing:

Thanks Wylie - I'll keep an eye on the progress of these.

Great work with Lens by the way....very smart visualization feature...!



Hi Wylie,

I actually just noticed another oddity on this issue. When using the two layers to obtain a mixed chart type (bar and line) and viewing in Lens the bar and line are given different colours:

But when I use this Lens visualization within a dashboard the bar and line values appear to get the same colour:

Any idea why this might be?


@stevedearl Can you show what happens in the tooltip/legend on your dashboard? The color assignment is based on the name of the series, so maybe the names are the same. If the names are unique then maybe we have a bug.

Hi Wylie,

I think you got it - the names of the series are identical so I guess that's why it's applying the same colours. I think this is another disadvantage/issue of trying to have multiple layers to show the mixed bar/line. As both series are for the same 'application' albeit one is for daily event data and the other is the moving average, they effectively have the same legend.

Pretty sure this isn't a bug though.... :slight_smile:


This is not a bug, but I see how it's confusing in this instance. On dashboards, by default Kibana tries to assign the same color to series names with the same name. As both of you series are called BankingOperation.application, they will get assigned the same color.

You can turn off this behavior (although just for the whole dashboard at once) by opening the "Options" menu and disabling the "Sync color palettes" option.

Thanks Joe,

Yep, I'd agreed with Wylie that this wasn't a bug on your side - just a consequence of how I was displaying to two series with the same name.
Thanks for the tip on turning off the colour syncing. I'll give that a try...!

Also thanks for the speed of response too.... :grinning:


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