Set colour categories by filtered values


I would like to be to apply a categorical colour scheme to a visualisation not fixed by value and only taking into account filtered values e.g. reb - blue - green ... will always show red and blue for the first 2 categories displayed taking into account the filtering.

Currently I can only set the colours based on all the data...not just the filtered data. This can sometimes be a problem when there are a relatively large number of categories as we sometimes get similar colours when only a few are selected with filtering.

I also need to apply this via python scripting.

Any advice would be appreciated,



(1) Answer