How show on/off state of something in plotly. 
Like in image attached state of screen,WiFi etc are shown w.r.t to time. A rectangle is shown for every ON interval.

One method is to draw rectangle for each and every interval separately using layout-shape attribute.
But in this method show/hide toggle of any one parameter say WiFi functionality by clicking on legends won't work.

Is there any other way to do this or any graph object available for this kind of plotting?

[![enter image description here](https://i.stack.imgur.com/pRMB9.png)](https://i.stack.imgur.com/pRMB9.png)