Pass sort order through AJAX for graphs