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

Bug? AutoRange with Step properties

1 Answer 31 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 02 Nov 2011, 10:21 PM
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

1 Answer, 1 is accepted

Sort by
0
Peshito
Telerik team
answered on 07 Nov 2011, 02:38 PM
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:
http://www.telerik.com/help/silverlight/radchart-features-axes-overview.html
http://www.telerik.com/help/silverlight/radchart-features-axes-x-axis.html

Kind regards,
Peshito
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
Chart
Asked by
Brian
Top achievements
Rank 1
Answers by
Peshito
Telerik team
Share this question
or