added data sorting to chart