Trying to sort the data before rendering it so the pie chart doesnt randomly flip around