Turn off Linear Axis AutoRange?

2 posts, 0 answers
  1. Schmid
    Schmid avatar
    1 posts
    Member since:
    Mar 2007

    Posted 19 May 2014 Link to this post


    I am facing the following problem:

    The RadChartView does automatically set the range of linear-axes (in my case the Y-Axis) - which is fine in most cases.
    However - I have one view, where I want the axis "origin" to be always 0 - no matter what the values are.
    To make matters worse, sometimes all values are positive, sometimes all are negative - so the simplest solution - setting the min/max of the axis does NOT work (for all positive I have to set Minimum = 0, for all negative I have to set Maximum = 0).

    I played around with the ExtendDirection property of the linear-axises, but saw no difference at all, no matter which value I used.

    Currently I have the following workaround:
    Bind Minimum and Maximum via a ValueConverter, which returns "0" or DependenyProperty.UnsetValue, depending on "all positive" / "all negative" values.

    Is there a better way to keep the origin of the vertical axis at "0" no matter what?

  2. Martin
    Martin avatar
    1048 posts

    Posted 22 May 2014 Link to this post

    Hi Sven,

    As you can see the chart is calculating the axis maximum/minimum and the step between its ticks based on the data points that are plotted on the chart. If you want to control the axis range you can use its Maximum, Minimum properties. 

    I can confirm that the described approach is good for your scenario. 

    Please let me know if you have further questions.

    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
  3. DevCraft banner
Back to Top