Refactored chart javascript to use jQuery instead of AJAX.