Skip to main content

Notifications

Power Apps Pro Dev & ISV
Unanswered

Using collection with colours field in chart itemColorSet

Posted on by 40
Hi All
I got a collection with one field of different colours .
This collection is used to create a Column Chart and I want columns in a chart to have a specific colour depending on a current value.
So I have a collection
   {V:34, c:RGBA(255, 204, 153, 1)} 
   {V:50, c:RGBA(255, 204, 204, 1)} 
   {V:64, c:RGBA(204, 255, 204, 1)} 
And I want chart columns to have those colours is per "c" field in collection 
I know itemColorSet property of the chart takes a table, but I just couldnt figure out how to convert collection into a table.
I tried
    Set(ColTable, Table(Collect.c))
but it gives me table of 10 digits numbers instead of colours :/ 
Any ideas?
Thanks
 
  • Suggested answer
    Nandit Profile Picture
    Nandit 1,091 on at
    Using collection with colours field in chart itemColorSet
    Hi 
     
    Are you using the Column Chart to display a singe value / single column in the visual?
    If yes, then you can use the following to achieve that directly in the iconColorSet:
    Switch(
        currentValue,
        34,
        [
            RGBA(
                255,
                204,
                153,
                1
            )
        ],
        51,
        [
            RGBA(
                255,
                204,
                204,
                1
            )
        ],
        64,
        [
            RGBA(
                204,
                255,
                204,
                1
            )
        ]
    )
     
    If you are trying to change color for multiple columns in the column chart using Value, I don't think that's achievable. 
     
    Hope this helps. 
     
    Kind regards, 
    Nandit
     
    If this answers your query, please mark this response as the answer.
    If its helpful, please leave a like. Thanks!
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

September 2024 Newsletter…

September 2024 Community Newsletter…

Community Update Sept 16…

Power Platform Community Update…

Tuesday Tip #2 Global Search…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 142,008

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,531

Leaderboard