Kibana metric plot with dynamic text based on the data

In the kibana dashboard visualization I need an metric plot to show the dynamic text based on the data. With the previous month gain.
Social Media KPI

If your Kibana is up to date, you can use the new Lens metric visualization (of 8.5):

  1. Subscribers gained config (primary metric) (if a subscriber is a single entry document in elasticsearch):

  2. Ratio of percentage increase from the previous month:

Thanks for the solution @Marta_Bondyra , does Kibana 8.4 lens metric allow only primary and secondary metrics, is there any way that I could have more than 2 metrics. As of now I'm using TSVB metric to show three metrics where I have to transform the data and add new fields as previous_month and the change in order to display it, but in this i can see that the query will automatically get the previous month data.

The new metric only allows two metrics, so the recommended approach is to use more than one visualisation to present more data.

Hey @eleven_e sorry for leading you into wrong direction, I confused the Kibana version - the reduced time range will be released in a couple of weeks from now in a version 8.5 so you'll have to wait a little to use it. Again, sorry!

Thanks @Marta_Bondyra

Hi @Marta_Bondyra is there anyway that i could use different colors for each bar in a bar graph?
Thanks

Thanks for the help @Marta_Bondyra , but i need to show the current month value, the previous month value and the change in a single metric is there any way?

When it comes to the different colors for different bars, this is something that we don't plan to support in Lens/Visualize, but you could use Vega, which is more complicated to write. However, maybe there are some workarounds in Lens that could serve you. Color on the bar chart can be set by breakdown dimension. If you know the values of the field that are different for each graph, you can set up the exact filters to achieve it, below is the example configuration.

Tell me more about your usecase and I'll try to figure it out.

For a string field:


For a timefield with an interval of 1d:



1 Like

Yes, this is easy and possible in existing versions!

  1. Set your time picker on current month.
  2. Create a visualization with a formula: count() - count(shift='1M'). Count() gives you this month results, count with a timeshift the previous month.


Thanks a lot @Marta_Bondyra , I'll try out this filter and breakdown.
My use case is I have 2 columns, one is the product categories and the other is the total number purchased, I need a bar graph on each category and the total purchased sum. I'm able to get the plot but I get all the bar graph as same color, my expectation is that i need different color for each category i.e for each bar.
Thanks @Marta_Bondyra

This is something great and useful.
Thanks @Marta_Bondyra .

I have an another doubt regarding the backup and restore!

Try switching the chart type from bar horizontal to bar horizontal stacked:

1 Like

Thanks @Marta_Bondyra .

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