Table sorting now updates the graph