This is a migrated thread and some comments may be shown as answers.

Bar chart - color & margin

1 Answer 72 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Jon Barron
Top achievements
Rank 1
Jon Barron asked on 07 Sep 2010, 03:53 PM

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.

1 Answer, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 09 Sep 2010, 05:10 PM
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
Tags
Chart
Asked by
Jon Barron
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Share this question
or