How to Remove Gaps between graphs, once hour filter is applied

Hello Team,
I have been trying to put filter of hour on my graphical dashboard, which I did by putting a scripted field of Hour, and the same I have added as filter on my graphical dashboard

However, their are gaps visible on graphs, when putting filter to hour as visible in above given snapshot. Is their any solution, where I can avoid the gaps.
For Eg.
If I am putting filter from 07 to 2300 Hour filter, there should not be blanks for 00:00 hours to 06:00 hours (as shown in given graphs)

Is this Lens? If so you could modify your chart setting 'missing values' and 'show as dotted line'. here's an example:



Hello, @Marta_Bondyra.
Thank you for your response. However, I specifically require a solution using TSVB (Time Series Visual Builder).

Note - The solution you provided is not suitable for a bar chart since it only supports line charts. Please provide solution for Bar chart also.

Unfortunately, we don't plan to extend this issue to TSVB, here's the issue with the explanation: TSVB Time Series Visualization - Handle "Missing" values · Issue #60802 · elastic/kibana · GitHub
In regards to bar chart, what exactly do you mean? How would you like them to appear? As there's no value in the buckets where they are missing, nothing can be printed. For line charts it's different because of their continuous character – because we can connect two points, but it's difficult to visualize for bar charts so we don't provide that.

1 Like

Thanks @Marta_Bondyra
One last query - instead of showing dot lines in Line chart for blank period. Is there any way to ignore the time period, for which filter is applied.

For example, If I am putting filter for 0800 to 1200 hour. So no 1300 hour is visible on axis. Any way to exclude Hours ?

Do you mean that you want to have a date histogram chart but the chart is skipping some time of the day? Unfortunately this is not possible, but there is a workaround that can serve you but only for one day at the time. You could set up a runtime field hour_of_day:

and then, instead of date histogram (which has a continuous character and unfortunately we cannot skip some periods) you could do filters visualization. Bear in mind that this can be performance heavy, so make sure it's not straining your Kibana too much. You can add labels to your vis to make it look more like a date histogram. This, as I mentioned before will work only across one day because otherwise the values will be summed.

1 Like

Hello Marta,

Unfortunately, I am getting this error when creating scripted field as given by you

or
after giving semicolon too

Try correcting it to getHour() (capitalized 'H')

1 Like

Thanks @Marta_Bondyra
I am able to draw graph now
However I would like to ask one more query -
When I am selecting two days, its summing up values, instead I want date wise hour from 07 to 23 hours. Dates are not getting reflected on axis...

Case - I need last 7 days data, which are having only Hours from 07:00 to 23:00 hours each day, without gaps

Yeah, I mentioned that in the workaround, unfortunately theres no way to do it for more than one day at the time :frowning:

1 Like

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