Refactor legend, add data flow with grouping symbol