Help in separating production data by shifts

  • What Grafana version and what operating system are you using? Grafana 9.4.3 with InfluxDB v2.6.1

Hello everyone, my client has requested the separation of their production into 8-hour shifts, specifically from 6 AM to 2 PM, 2 PM to 10 PM, and 10 PM to 6 AM. Using the aggregateWindow function in Flux, I’ve managed to apply an offset, and the bars are displayed within these periods. However, for better visualization, I would like to assign a different color to each shift bar, for example. Does anyone know of a way to improve this visualization?

Hi @aieseresy

I think three separate Flux queries will be needed in order for you to assign separate shift colors in Grafana. The tricky part is that the hourSelection function does not span multiple days, so you’ll have to use a special filter by time function. See here and here.

Thank you for the replay! I’ve been testing two methods, hourSelection and filter(fn: (r) => date.hour... , and it seems that I’m having some issues with the time zone. How could I adjust this?

is your data timestamp UTC?