Change logic that orders chart