Fix chart update bug and sort issue.