Automatically add a legend to the graph if labelled data is found, except if user explicitly disabled the legend.