Bar chart - color & margin

2 posts, 0 answers
  1. Jon Barron
    Jon Barron avatar
    24 posts
    Member since:
    Oct 2012

    Posted 07 Sep 2010 Link to this post


    I'd like to be able to set the margin between bars to zero so there is no gap between them.

    I'd like to be able to color each bar differently depending on the value of the item. i.e. if the value is <80, color it red, if it's between 80-100, color it yellow, and if it's >100, color it green. I'm fine if I have to do this programmatically.
  2. Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 09 Sep 2010 Link to this post

    Hello Jon Barron,

    To be able to set the distance between bars to zero use the ItemWidthPercent property and set it to 100% like this:
    this.RadChart1.DefaultView.ChartArea.ItemWidthPercent = 100;
    You should also change the LayoutMode property of the AxisX to Auto, Between or Inside according to what you like.

    For your second question there is a good help topic here - http://www.telerik.com/help/silverlight/radchart-styling-and-appearance-custom-item-style.html. There is described exactly how to color the bars in a specific color, depending on their value. You can also check this online example - it shows how to apply MVVM pattern to achieve this.

    Regards,
    Evgenia
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top