Adding information about the number of words per query and sorting the
graphic's legends