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
655
How to customize the colors of a PieChart?
posted

Hello,

I'm new to the pie chart control. Does anybody know how to customize the colors of a PieChart? I'm not going to use any theme, just want to change the default colors of a pie chart.

 

Best regards,

Zach_Shine

  • 2671
    Verified Answer
    Offline posted

    Hi Zack,

    Have a look in here - http://help.infragistics.com/jQuery/2012.1/ui.igPieChart#options - there's a brushes collection that does exactly what you need. All you have to do is pass it a set of colors.

    have a look at this fiddle - http://jsfiddle.net/damyanpetev/cQALF/ (beware - random colors, not too pretty :P )

    The colors are assigned in order, so the first color will be assigned to the first pie slice (with the first data records) and so on. The number of colors you define is not restricted in any way that i'm aware of and they repeat if records are more than the colors. That means you can define a single color that will be applied to every slice, or two to make an odd-piece style.

    Regards,

    Damyan