legend color according to a specific field and legend label on the other field in vega lite

39 Views Asked by At

I am creating a horizontal stack bar chart and want to add legend , but i want legend color on the basis of field are define in my data(i.e color_name) in each data element data formata

i want legend use my color field and also show legend label on the basis of different field i.e "occuring_event" . how it is possible what are modification in data set require to achieve this.

i just used scale range in specs as but not look same as i want scale range use plz check in editor

1

There are 1 best solutions below

2
davidebacci On BEST ANSWER