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

Widening the XAxis Label

1 Answer 77 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nishan
Top achievements
Rank 1
Nishan asked on 12 Aug 2011, 11:08 AM
Hi,

I am trying  to populate a bar chart Dynamically and have been successful so far. My only problem is that I'm not able to widen the lable's of the XAixs. 

I have tried the following code but without any success. (catList is the string array which contains the xaxis items, chart1 is the instance of the chart control )

            ChartAxisItem[] items = new ChartAxisItem[catList.Length];
            ChartAxisItem itm;
            chart1.PlotArea.XAxis.Appearance.TextAppearance.MaxLength = 100;
            for (int i = 0; i < catList.Length; i++)
            {
                itm = new ChartAxisItem(catList[i].Length > 20 ? catList[i].Substring(0, 20) : catList[i]);
                itm.Appearance.RotationAngle = 315f;
                itm.TextBlock.Appearance.MaxLength = 150;
                itm.TextBlock.Appearance.Dimensions.AutoSize = false;
                //itm.TextBlock.Appearance.Dimensions.Height = Telerik.Reporting.Charting.Styles.Unit.Pixel(25f);
                itm.TextBlock.Appearance.Dimensions.Width = Telerik.Reporting.Charting.Styles.Unit.Pixel(200f);
                chart1.PlotArea.XAxis.Items.Add(itm);
            }

I have also attached a screen print of the chart.


Thanks

Nishan

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 12 Aug 2011, 04:57 PM
Hi Nishan,

Either increase the chart size in general or increase the PlotArea -> Appearance -> Dimensions -> Margins -> Bottom property.

Best wishes,
Steve
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Tags
General Discussions
Asked by
Nishan
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or