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
2030
Color area based on the value of the item: xamDataChart 16.1
posted

Hello,

I am using a xamDataChart (16.1) and want to color the area based on the value of the item.

This discussion looks like that there was no built in functionality to achieve this: http://www.infragistics.com/community/forums/t/51914.aspx

Has this feature been implemented sind 2012?

If yes, please point to the needed properties. If no, what is the best way to get it done?

Requirements:

1. The item has a property to decide its color

2. It can be that the items can provide the color itself

2. Or it can be decided on a property e.g. positive/negative number

Thanks

Niko

Parents
No Data
Reply
  • 34430
    Verified Answer
    Offline posted

    Hello Niko,

    If you are using the ColumnSeries like what is referenced in the link that you have provided, this can be done in 16.1 by handling the AssigningCategoryStyle event on the series that you are looking to style. Note, to handle this event, you will need to also set the IsCustomCategoryStyleAllowed property on your series to "True."

    This event will fire for each column that gets generated. The event arguments contain everything that you will need to check the item that exists for a particular column by using the e.GetItems method with the e.StartIndex and e.EndIndex properties, where e is the event arguments. You can then utilize the e.Fill property to assign a new brush to that particular column.

    If you are using a series other than a ColumnSeries, this becomes more complex as I believe that the AssigningCategoryStyle event will only style the markers for other series types such as LineSeries, AreaSeries, etc. If you are using a different series-type than ColumnSeries, please let me know.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer

Children