Added a parseInt for table legend sorting