Sort the stack chart