I've got hopefully a simple request, but layered in a few issues. I've got pie charts showing a percentage progress of files I get, which I mark "yes" when I get the files I need (it's a Yes/No column). So this is a simple true or false pie chart. Problem is, the colors can change depending on the status of the first record in my SharePoint list. This image below has it's ItemColorSet to where Red is first (because the first record is false) and the Green is true. I didn't realize that the order of colors is based on the value of the column in the first record. If I change it to true, the colors switch and are incorrect.
So I saw through other posts that you can define the colors based on the result using ItemColorSet and the Switch function, but I must be doing something wrong, as it shows colors I haven't defined:
Do I need to use a different column? AddColumn? Not sure, I'm stuck!
Thanks very much for the help
Can you share a bit more about your issue?
Can you show me the error info about your issue?
Do you want to define the color based on the result?
I made a test .
I created a sharepoint list named ‘test3’.
Set items property of piechart1 to:
Set itemcolorset property of piechart1 to:
Hi Eason! You are exactly right - I want to define the color by the results of the record in the column. It's a yes/no column so the only options are true and false.
So, your example at least got me a result, which was further than I was able to take it - however the colors it's showing are wrong...
See my attached image for the code!
please try to recreate a Pie Chart and check if it is solved
Hi Eason, here is a new screen with a new pie chart applied - same code to group the records by true/false but with your ItemColorSet code. Still getting the light green/blue combo instead of red and green.
Now that I think back - the column in question is actually a calculated column based on an ISBLANK of a different column. But the result is set to yes/no, and the resulting colors are still the same.
I also tried publishing the app and looking at the published results as I have heard sometimes that changes things. No changes for my app though.
Any insight greatly appreciated!
Also I tried changing the result of the first record of that column to "true" - the colors switched, which tells me that the ItemColorSet code seems to be bypassed to get this result, and it's defaulting to the colors displayed when there is a blank ItemColorSet.
Keep up to date with current events and community announcements in the Power Apps community.
A great place where you can stay up to date with community calls and interact with the speakers.
Check out the latest Community Blog from the community!