Hi all,
Can't figure out how to get the conditions of the colours of my chart to correspond to the true false value... For context, the chart is getting data from a collection and I think the first data dictates whether true or false will be red and the other would be green.
Is there a - If true = green, if false = red condition?
Hi @DJIX12 ,
Can you please use what you have for the Pie Chart Items property and apply that to the Items property of the hidden gallery. Then set the Items property of the pie chart to refer to galHidden.AllItems as per my earlier post: https://powerusers.microsoft.com/t5/Building-Power-Apps/Pie-chart-colour-conditions/m-p/2316602/highlight/true#M578990
Sorry I was away from work for a bit. The hidden gallery trick doesn't work for my case because the gallery would give me every line item as supposed to giving me a count of items = true and items = false like your gallery does.
Hi @DJIX12 ,
No it wouldn't, but that's not necessary since the colours will follow the data rather than the other way around.
But the gallery wouldn't be sorted would it?
Hi @DJIX12 ,
What you can do is to insert a hidden gallery and set its' Items property to what you currently have as the Items property of the Piechart. Like this it can be referenced from both the Items and ItemColorSet properties of the PieChart:
In the above I left galHidden visible to show what I mean, but its' Visible property should be set to false.
It is a collection and this is the items property for my pie chart
AddColumns(
GroupBy(Filter(Source, 'Transaction'.Value = "ABC123"), "FirstTimeRight_x003f_","GroupData"),
"Percentage",
CountRows(GroupData)/CountRows(Filter(Source, 'Transaction'.Value = "ABC123"))
)
Hi @DJIX12 ,
May I ask what the Items property of your Piechart looks like?
In case you are using a collection, you could use something like the below for the ItemColorSet:
ForAll(
colPiechart,
Switch(
ThisRecord.Label,
"True", Color.Green,
"False", Color.Red
)
)
FYI this is what the collection looks like:
ClearCollect(
colPiechart,
[{Label: "False", Percentage: 30}, {Label: "True", Percentage: 70}]
)
and this is the result:
WarrenBelz
98
Most Valuable Professional
MS.Ragavendar
60
stampcoin
48