Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I got a pie chart with Dimension = Counry, and Expression = Sum(Sales)
I want the color the parts of the pie depending on the name of the country
I got 7 countries
in the colors tab I want to write something if Country = X , Red(), if(Country = Y, Green(),...
Please advise
You can use an expression like pick(Match(Country,'X','Y', ...),red(),green() ...) to match colors with countries. Or you could add a color table to your load script like explained here.
Try using a background color attribute expression in expression tab (open attributes by clicking on the plus sign next to your expression).
Ok but how do I know the value of the country?
Try just as you already proposed:
if(Country = 'A', rgb()...
You can use an expression like pick(Match(Country,'X','Y', ...),red(),green() ...) to match colors with countries. Or you could add a color table to your load script like explained here.
ok one more thing
the dimension that I have is actually a cyclic group
I'm using now GetCurrentField to see if the cyclic group is now grouping by country and I used your suggestion above
now if the group is not by country I want to reuse the default colors that the pie chart usually show
in fact now i'm getting Black if I change the group to other than Country
Please advise