Only create the histogram once the user clicks the "histogram" tab

This is just for @tomw2 to take a look at my implementation...

[1452]