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
485
XamDataChart multiple Bar/Column Series with different colors
posted

Hi,

Recently your support team member suggested me to upgrade my Infragistics version from 11.2 to latest 15.2.
While doing the same I am facing some problems, one of which I have mentioned below. Please reply ASAP with the simplest and efficient solution.

Earlier in XamChart, we had datapoints and we could define different color for datapoints and as a result when we need to show different data on same chart, we used a bar series and set colors on datapoints accordingly. But as I see in the v15.2 dll, there is xamdatachart and column series to show such bar/histogram graph, right? I could not see the datapoint approach anymore now. So my questions are:

1.) How can I bind colors with values?

2.) If I use multiple series for different categories, I can set different color, but then all the series gets attached and does not come up to their own and expected X-Axis label.

I am attaching a sample project to make you better understand the problem. Please modify the same and revert back. If you can, please send me the solution with both single series and multiple series sample.

Thanks in advance!

BarSeriesHight.zip
Parents
  • 34510
    Verified Answer
    Offline posted

    Hi Rob,

    You don't need to use multiple column series in order to color each column separately.  The ColumnSeries class has an event called AssigningCategoryStyle.  This event fires for each category (each column basically) that exists in the series.  The event arguments allow you to choose what color to use for that column and it also provides you with the item associated with that column so you can use it to determine what color to show.  I modified your sample to show how this works.

    Let me know if you have any questions on it.

    BarSeriesHight.zip
Reply Children