Fixing error in returLegend for a line chart