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
625
Column Chart - Color
posted

Hi,

I am plotting a column chart  I want to add different color to each column.

I am binding a dataset to the chart, my data is fetched as follows

Column1            colum2

10                       Active

20                      Pending

Please find attached an image, I want different color for Active column and Pending column

Can you please guide me, how to proceed with this

 

 

  • 5118
    posted

    Hi,

    There are several options to do this:

    1 -  You can set the color model scheme to use dynamically:

        myChart.ColorModel.ModelStyle = Infragistics.UltraChart.Shared.Styles.ColorModels.CustomLinear;
        myChart.ColorModel.CustomPalette = New Color[ { Color.Green, Color.Purple };

    In this case Active would be Green and Pending would be Purple.

    2 - You can  set the ModelStyle to CustomSkin and define a Collection of PEs (Paint Elements) and define 2 PEs and set them up with the appropriate colors.  Set the Skin.ApplyRowWise to False and you'll get the same effect. 

     3 - You can get access to the underlying Primitives (FillSceneGraph event or ChartDrawItem) and modify the Paint Elements on the Primitives that represent the columns (Box Primitives) directly.