'How to create 100% Stacked Bar Chart with 2 sets of Groups using 4 columns (Timeseries)

I'm trying to create a 100% Stacked Bar Chart with 2 groups using 4 columns in my dataset to be displayed on a timeseries. I'm currently having challenges putting the 2 groups side by side and ordering (small % above the larger % below) the stack for each date using Plotly in R. As shown on the attached. Currently it is stack-up all columns for every time period together causing a 200%. Any Idea on how to resolve this would be greatly appreciated. 4 Columns 100% Stacked Bar Chart



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source