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

Scatter Plot - Reverse Axis

3 Answers 82 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 13 Jan 2014, 08:47 AM
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

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 14 Jan 2014, 12:28 PM
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 >>
0
Paul
Top achievements
Rank 1
answered on 29 Aug 2014, 03:15 PM
Just following up...has this (reverse axis direction) been added to RadViewChart yet?
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 03 Sep 2014, 12:14 PM
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.
 
Tags
ChartView
Asked by
Brian
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Paul
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or