fix legend to work with qualitative data