Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
595
Setting Pie XamChart Colors in Code
posted

I have a Pie Chart whose datasource is getting bound dynamically based on user input.  I do not like the default colors -- they are not distinct enough -- how can I set  the colors of the wedges directly in the code?

Parents
No Data
Reply
  • 450
    Offline posted

    I too have this problem.

    You can set the colors in code for the pie chart slices via this mechanism:

            xamChart1.StartPaletteBrush = Brushes.Red;

            xamChart1.EndPaletteBrush = Brushes.Green;

    But regardless of which two colors you choose for the palette brushes, the colors generated are not distinct enough and are impossible to distinguish if the pie chart has 8 or more slices.
    How can I specify a palette that has a wider range of colors, preferably one that is visually pleasing.

     

     

Children