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

Turn off Linear Axis AutoRange?

1 Answer 114 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Infolink
Top achievements
Rank 1
Infolink asked on 19 May 2014, 01:37 PM
Hello,

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?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 22 May 2014, 09:50 AM
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.

Regards,
Martin
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
Infolink
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or