Noob Help - Graphing On/Off States

Apologies in advance for my ignorance.

I’m trying to graph a time series of the On/Off states for 5 devices all in one panel. I’d like it to look similar to this example (which has only two devices graphed):

I’ve managed to create this graph using Stacking, but when devices go “Off”, the graph collapses:

Any advice or pointers would be appreciated. Thanks.