tidy new_line_chart code, add legend