Set legend_id on every expression