Allow to toggle the legend for a graph