Plotly analog of a Pivot chart from Excel

Hello everyone! Who knows how to make a Plotly analog of a pivot chart from Excel?
Example:

My solution is based on subplots, but it’s not very flexible. Help) .It’d be cool to hear your thoughts.