Monthly data

2 posts, 0 answers
  1. Abdulhameed
    Abdulhameed avatar
    27 posts
    Member since:
    Jul 2010

    Posted 15 May 2011 Link to this post

    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?
  2. Yavor
    Yavor avatar
    11 posts

    Posted 18 May 2011 Link to this post

    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.

    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