web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Changing colours on a ...
Power Apps
Unanswered

Changing colours on a pie chart

(0) ShareShare
ReportReport
Posted on by 394

Hi all,

 

This may be quite simple but I cant figure out on how to change the slice colours in a pie chart any ideas?

 

Screenshot 2021-11-03 at 4.31.53 PM.png

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @AB1 

    Colors are controlled by the ItemColorSet property.  It expects a table of color values. The order of the colors in that table correlates to the order of the items in your Items property.

     

    I hope this is helpful for you.

  • AB1 Profile Picture
    394 on at

    Hi @RandyHayes So it can be changed and I have to had in item property? Can even specify the slice colour? (if this makes sense)

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @AB1 

    Your Items property is the data for the chart.  It will not contain colors.

    The ItemColorSet is a table of colors that will govern how the slices look.

    For example, this default pie chart and changing it's colors:

    AB1.gif

    To accomplish this is very simple.  The dropdown control in the image has an items property of:

    Table(
     {Disp: "Original Colors", ColorSet:
     [RGBA(49, 130, 93, 1),RGBA(48,166,103, 1), RGBA(94,193,108,1), 
     RGBA(246,199,144,1), RGBA(247,199,114,1), RGBA(247,180,91,1), 
     RGBA(246,143,100,1), RGBA(212,96,104,1), RGBA(148, 110, 176, 1), 
     RGBA(118, 154, 204, 1), RGBA(96, 197, 234, 1)]
     },
     {Disp: "Wild Colors", ColorSet: 
     [Red, Green, Yellow, Blue, DarkGreen, LightBlue, urple, DarkGray, 
     DarkMagenta, LightSteelBlue]
     },
     {Disp: "Crazy Colors", ColorSet: 
     [Magenta, Purple, DarkMagenta, Crimson, DarkOrchid, DeepPink, GreenYellow,
     MediumSpringGreen, SlateBlue, Yellow]
     }
    )

    You will see in this that the first record "Original Colors" has a column called ColorSet that is a table of all the colors that were found in the default PieChart.

    The second and third records just have different names and ColorSet tables.

     

    For the Pie Chart, the ItemColorSet is set to: drpColorSelector.Selected.ColorSet  (where drpColorSelector is the name of the Dropdown mentioned above).

     

    That is all there is to it!

     

    So, you obviously don't need a dropdown to change colors and this was JUST a demonstration, but the key point here is that the ItemsColorSet table determines the colors used in the Pie Chart.  The order of the colors in the table will correspond to the order of the items in the table supplied to the Items property of the Pie Chart.

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard