Bug? AutoRange with Step properties

2 posts, 0 answers
  1. Brian
    Brian avatar
    73 posts
    Member since:
    Sep 2010

    Posted 02 Nov 2011 Link to this post

    When I set the AutoRange for an axis and then specify a Step value, the Step value is being ignored.  I would expect the two properties to work in conjunction with each other where the max and min are autoranged but the labels/ticks are marked via the specified Step value. 

    I would consider the current behavior a bug.

    Version: 2011.2.712.1040
  2. Peshito
    Peshito avatar
    585 posts

    Posted 07 Nov 2011 Link to this post

    Hi Brian,

    The Step property only works when the AutoRange is set to False. In order to achieve scenario like yours, you could wire up the following method to the LayoutUpdated event.
    void radChart1_LayoutUpdated(object sender, EventArgs e)
                var minValue = radChart1.DefaultView.ChartArea.AxisX.ActualMinValue;
                var maxValue = radChart1.DefaultView.ChartArea.AxisX.ActualMaxValue;
                radChart1.DefaultView.ChartArea.AxisX.AutoRange = false;
                radChart1.DefaultView.ChartArea.AxisX.AddRange(minValue, maxValue, 3);
    Using this approach you will only change the step with turning off the AutoRange property.

    Alternatively you could also use the axis' LabelStep property, which specifies the value indicating that only one out of n-axis labels should be visible, where n is the value of the property.

    More about axes can be found here:

    Kind regards,
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top