Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

pie charts setting default color

hi

i have created a pie chart.. normally when we select one data value the pie chart becomes one individual color cz it represent only one value.. is there any possibility that i can fix the pie chart (normally when we select detach the pie chart values wont change/ move) but when i select a particular value except that particular segment, the other segments has to change in to a default color(ash color)

Untitled1.png 

this image shows my present display Untitled1.pngif i select the blue area with the value 11074 i want my pie chart to be displayed as the below image..

if some one can help me in this it would be really appreciated..

thank you in advance

38 Replies
Not applicable
Author

nothing happened 😕 tried both ways

SergeyMak
Partner Ambassador
Partner Ambassador

Can you share your app?

Regards,
Sergey
Not applicable
Author

sorry Sergey i can't share it cz of office reasons 😕 the colors change in to all pinkish colors doesn't look professional at all 😕

SergeyMak
Partner Ambassador
Partner Ambassador

Please share screenshot of your color tab

Regards,
Sergey
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Looks like you have more than 18 values. Try adjusting your expression as follows:


=if(Source=Source, color( mod(FieldIndex('Source',Source)-1,18)+1 ), LightGray())


-Rob

Not applicable
Author

d.png

Not applicable
Author

hi Rob

after adding your expression my chart looks like the below image 😕 i have colors repeatingin.png

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

There are only 18 colors in the palette. The only way I can think of is to avoid repeating colors is to assign a unique color to every dimension value in the load and then a reference to that color in the background color expression.

Alternatively, you could get a better distribution across 18 colors with an expression that uses some combination of index() and concat() to sequentially assign from the 18 color palette.

However, I would question the overall usefulness of having a Pie with some many slices. Have you considered using Dimension limits to limit to the top n values and throw the rest into the "Others" bucket?

-Rob

Not applicable
Author

Rob i have only 10 segments as shown in the above image... i want to show these 10 segments without repeating the colors and i really would prefer if i could change this color code and make it more professional is it possible??

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I feel like I'm missing something. You shouldn't have repeating colors if your underlying data has less than 18 values, but maybe I'm misunderstanding something. It would be easier if you could share a scrambled version of your app. Anyways, here's an expression (getting complex though) that will distribute any values over the 18 colors.

=if(Customer=Customer

,color(mod(

Match(

Customer

,$(=chr(39) & concat(Customer,chr(39) & ',' & chr(39)) & chr(39))

)

-1,18)+1)

, LightGray())