views:

369

answers:

1

Hello, i`d like to set colors in codebehind for every Pie Slice in my PieChart. Anyone knows how to do this? Now it gets the colors from the styles xaml, but i need to assign the colors for each value (pie slice) by myself from codebehind.

A: 

One possiblitiy is to construct your colours from HSL or HSV, keeping the SL/SV part fixed you can divide the entire hue range into the number of pie slices you have, this should ensure they are reasonably visually seperated. different SL/SV values will make the chart vibrant colours or pastels or dark shades etc.

jk