Legend fix

ShowLegend used to be permanently set to true. The logic for setting the legend was moved to updateLegend and out of the constructor for the graph.