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

Wrap text in item labels on axis

1 Answer 89 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Romain
Top achievements
Rank 1
Romain asked on 27 Jul 2010, 03:43 PM
Hi,

I have to make a chart in pure C#.
I want the items label on the axis to have a width of 120 and to wrap text content if it's too large.
I've tried to apply a style this way :

Style styleLabel = new Style(typeof(TextBlock));
styleLabel.Setters.Add(new Setter(TextBlock.TextWrappingProperty, TextWrapping.Wrap));
styleLabel.Setters.Add(new Setter(TextBlock.WidthProperty, 120));
 
telerikChart.DefaultView.ChartArea.AxisY.AxisStyles.ItemLabelStyle = styleLabel;

But, it doesn't work.

Please tell me what's wrong.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Romain
Top achievements
Rank 1
answered on 28 Jul 2010, 11:25 AM
I was redefining telerikChart.DefaultView.ChartArea.AxisY after the stub shown.
My mistake.
Tags
Chart
Asked by
Romain
Top achievements
Rank 1
Answers by
Romain
Top achievements
Rank 1
Share this question
or