add sortByTotal function

Allow sorting of series by the total/sum.