Convert text file to bar graph

So I'm support to convert an Insertion and Selection sort to sorted bars, but I keep using a completely incorrect method.

From Algorithms, 4th edition by Sedgewick and Wayne:

"Add code to Insertion and Selection to make them draw the array contents as vertical bars like the visual traces in this section, redrawing the bars after each pass, to produce an animated effect, ending in a “sorted” picture where the bars appear in order of their height. "