Sorting stacked columns using values from another column

Hi @BennyBeatts , remember put a reproducible example for better help you all the community.

If I understand well, you need make before an order of this column and next make the plot.
First, check the correct name of $_CLEARED


data2 <- data[order($_CLEARED),]

# Next make the plot.