Bar color binding

Thread is closed for posting
2 posts, 0 answers
  1. Alex
    Alex avatar
    23 posts
    Member since:
    Oct 2011

    Posted 28 Feb 2012 Link to this post

    Is there any way to bind bar chart single bar color to datasource?
  2. Victor
    Victor avatar
    1358 posts

    Posted 02 Mar 2012 Link to this post

    Hello Alex,

    Thanks for using our support.
    Please clarify what kind of DataSource you are referring to.
    When you have a bar series, each bar can be described by a point template. See for example how to create
    an orange bar and a blue bar:

                <Rectangle Fill="DarkOrange" />
                <Rectangle Fill="Blue" />
        <telerik:CategoricalDataPoint Category="1" Value="0.9" />
        <telerik:CategoricalDataPoint Category="2" Value="0.6" />

    If you know how many bars you will have and if the order of the bars is consistent, you can set different templates for the different bars. Also you can use the PointTemplateSelector property and implement your custom logic (DataTemplateSelector class) for choosing the appropriate bar color.

    Please write again if you need further assistance.

    Kind regards,
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top