Scatter Plot - Reverse Axis

4 posts, 0 answers
  1. Brian
    Brian avatar
    24 posts
    Member since:
    Apr 2008

    Posted 13 Jan 2014 Link to this post

    Hi,

    Is it possible to reverse the direction of plot axes?

    Eg. plotting depths, zero will be at the top of the plot area.

    The primary axis seems to be bound to the x-axis (horizontal axis), eg. in relation to trackball and indicators. Is this correct?

    Regards
    Brian
  2. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 14 Jan 2014 Link to this post

    Hi Brian,

    Thank you for writing.

    Although currently this is not supported by RadChartView you can use a custom format provider in order convert the values. Please note that in order this to work properly you should set negative point values:
    public class MyCustomFormatProvider : ICustomFormatter, IFormatProvider
    {
        public string Format(string format, object arg, IFormatProvider formatProvider)
        {
            int value;
     
            int.TryParse(Convert.ToString(arg), out value);
     
            return Math.Abs(value).ToString();
        }
     
        public object GetFormat(Type formatType)
        {
            if (formatType == typeof(ICustomFormatter))
            {
                return this;
            }
     
            return null;
        }
    }

    Also you can change the provider like this:
    LinearAxis verticalAxis = radChartView1.Axes.Get<LinearAxis>(1);
    verticalAxis.LabelFormatProvider = new MyCustomFormatProvider();

    I have attached a sample project to show you how this works in a complete project.

    I hope this will be useful. Should you have further questions, I would be glad to help.

    Regards,
    Dimitar
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Paul
    Paul avatar
    4 posts
    Member since:
    Mar 2013

    Posted 29 Aug 2014 in reply to Dimitar Link to this post

    Just following up...has this (reverse axis direction) been added to RadViewChart yet?
  5. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 03 Sep 2014 Link to this post

    Hello Paul,

    Thank you for writing.

    This is a reasonable request and we already have it logged in our feedback portal. You can track its progress, subscribe for status changes and add your vote/comment to it on the following link - feedback item
     
    I hope this information helps. Should you have further questions, I would be glad to help.

    Regards,
    Desislava
    Telerik
     
    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.
     
Back to Top