Added a legend 'reverse' sorting option

The new option orders the legend in reverse order of the series, resolving #865.