How to create a timeline chart for window sensors?

How would one create a timeline chart for window sensors? I think I already saw a topic about this, but I can’t seem to find it.

The chart should rougly look like this, of course, with different colors instead of xs and Os:

Window One | xxxxxOOOOOOxxxxxxxxxxx |
Window Two | xxOOOOOxxxxxxxxxxxxxxx |

Hello,

have a look here

So far, the best answer I have found for this question is

However, it seems to be non-trival to design such a chart. I will see how far I can get and share the code once/if I succeed.