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
337
Pie Chart color
posted

Hi,

 

I have added 9 colors itmes to PEs, duplicate color as coming in chat, as show in picture . How to prevent it.  Is possible to assign the color order based on Weight of chat example Red for biggest ratio, green to less, etc...

 

thanks.

 

 

 

 

     private void chartPEs(Infragistics.Win.UltraWinChart.UltraChart uc)

        {

            uc.ColorModel.ModelStyle = Infragistics.UltraChart.Shared.Styles.ColorModels.CustomSkin;

            uc.ChartType = ChartType.PieChart;

            uc.ColorModel.Skin.PEs.Clear();

            uc.ColorModel.Skin.ApplyRowWise = true;

            uc.ColorModel.Skin.PEs.Add(new Infragistics.UltraChart.Resources.Appearance.PaintElement(Color.FromArgb(104, 115, 122)));

            uc.ColorModel.Skin.PEs.Add(new Infragistics.UltraChart.Resources.Appearance.PaintElement(Color.FromArgb(229, 142, 26)));

            uc.ColorModel.Skin.PEs.Add(new Infragistics.UltraChart.Resources.Appearance.PaintElement(Color.FromArgb(179, 8, 56)));

            uc.ColorModel.Skin.PEs.Add(new Infragistics.UltraChart.Resources.Appearance.PaintElement(Color.FromArgb(116, 115, 169)));

            uc.ColorModel.Skin.PEs.Add(new Infragistics.UltraChart.Resources.Appearance.PaintElement(Color.FromArgb(253, 187, 48)));

            uc.ColorModel.Skin.PEs.Add(new Infragistics.UltraChart.Resources.Appearance.PaintElement(Color.FromArgb(79, 114, 29)));

            uc.ColorModel.Skin.PEs.Add(new Infragistics.UltraChart.Resources.Appearance.PaintElement(Color.FromArgb(186, 188, 190)));

            uc.ColorModel.Skin.PEs.Add(new Infragistics.UltraChart.Resources.Appearance.PaintElement(Color.FromArgb(141, 200, 85)));

            uc.ColorModel.Skin.PEs.Add(new Infragistics.UltraChart.Resources.Appearance.PaintElement(Color.FromArgb(125, 170, 190)));

            uc.PieChart.OthersCategoryPercent = double.Parse(utxVarious.Text.ToString());

        }