hmm i have inputted the expression based on your recommendation in the expression ("sum(sales)") clicked on the + and entered the following in the "pie popout":
=pick(match(Colour, 'black'), RGB(0,0,0))
But the black is still blue
What am i doing wrong?
This expression assumes that the colour field is named Colour and is the dimension of the pie chart (so that each slice only has one possible colour). Update the expression with the correct field name.
Go to properties of the chart object and go to colors tab.
if you are using pie chart and it having 6 different value in one dimension.
Jan,Feb,March,April,May and June.
If you want to change the color , you have to change the (Colors 1-6) in Data Appearance in "Color tab". Just click the color which you don't want and change the color and click apply.
Hope it will help you,
Please check the attached file..
Pie Chart in first sheet..
Please see the background color expression in expression tab. by expand the '+' sign.
Hope that helps
Tabla.qvw 163.5 K
I suggest building a table for the colors instead of handling it in expressions. You're surely going to want these colors in multiple places, which means repeating the expression. You could create a variable to hold the expression and use the variable, but I'd build a color table instead. I just think it's cleaner, and would allow you to load colors from an external source like a spreadsheet if desired. It requires script access and a reload to change, of course, which might occasionally be an issue.
The attached example allows you to explicitly assign colors to customers by RGB values, and then automatically builds random colors for any customers you didn't assign. You don't want the random color part in this case, so skip that and make certain that all colors are assigned.
The color expressions in these charts are also more complicated than you'd likely need. All you'd need is rgb(R,G,B) in most cases. These charts were doing more complicated things like highlighting the weekday data.
Edit: Ooops, sorry, I see you're in personal edition. I'll make another edit to tell you all the relevant information.
Edit 2: Actually, rather than describe the example I posted, let me just give you what I think you should do. Consider a spreadsheet instead of an inline load, but here's the idea. In the script:
LOAD * INLINE [
Then in the chart, in the background colour expression:
This is great!!.
We have similar scenario where we are applying colors to charts using ColorTable.
We have two tables in QV
Data table with all facts and dimensions
ColorT table with mapping dimension and RGB values
ColorT table doesn't have all the values from my dimension column hence it will apply colors to values which are present in ColorT table.
After applying formula in background color:
We need to change the color for other values to default colors.
Could you please help us to tackle this?
Maybe something like if(R+G+B,rgb(R,G,B)). As long as you assign null to the color, it should use the defaults.
However, if you look closely at the example, I gave an arguably more robust solution to the same problem, which was to assign random colors to values that you haven't assigned explicit colors to. That way you're still using the same colors for those values across charts, even when you don't know what the values will be ahead of time to explicitly assign colors to them. On the down side, random colors won't always look very good, but if you reload the example over and over, I think the way I assigned random colors produces pretty good results for customers D & E.