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

Monthly data

1 Answer 15 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Abdulhameed
Top achievements
Rank 1
Abdulhameed asked on 15 May 2011, 11:02 AM
I am trying to build a chart that show monthly data on the xAxix I am displaying Month Name using the default label format.
However I wont to force the chart to display all months names because currently it is displaying Jan .... Mar .... May

I tried to change the step property with no success, Please advise?

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 18 May 2011, 08:40 AM
Hello Abdulhameed,

Basically, when the axis is autoranged, the values are arranged for best layout and visibility. Thus, if you have a larger number of values, not all of them will be rendered along the axis. One possible approach in this case would be to turn off the autorange for the axis, set the min and max values, as well as the step. This may look something like this:

RadChart1.DefaultView.ChartArea.AxisX.AutoRange = false;
RadChart1.DefaultView.ChartArea.AxisX.Step = 1;
RadChart1.DefaultView.ChartArea.AxisX.MinValue = 0;
RadChart1.DefaultView.ChartArea.AxisX.MaxValue = 37;

Additionally, such a setup is only meaningful, when the axis is numeric - i.e. you are setting xvalues along it. If you use an xCategory, all values will be rendered:

ItemMapping itemMapping1 = new ItemMapping();
itemMapping1.FieldName = "index";
itemMapping1.DataPointMember = DataPointMember.XCategory;

thus, in your case, you can use an xcategory for the month values, and all of them should be rendered.
I hope this information helps.

Greetings,
Yavor
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
Abdulhameed
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or