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

Is it possible to set Max & Min value of LinearAxis via C# code dynamically?

2 Answers 137 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Yong Kang
Top achievements
Rank 1
Yong Kang asked on 19 Jun 2013, 12:11 PM
Dear all,

I managed to set the Maximum & Minimum value of the object chart:LinearAxis via C# code dynamically. May I know if it is possible? If yes, the code snippet is preferred.

For example, I hope I can change the below 0.95 & 0.97 to 99 & 100 or 30 & 60 freely based on the range of the returned data list.

Thanks.

<chart:RadCartesianChart.VerticalAxis>
         <chart:LinearAxis Minimum="0.95" Maximum="0.97"/>
</chart:RadCartesianChart.VerticalAxis>

2 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 21 Jun 2013, 11:41 AM
Hi Yong Kang Chen,

There is a mapping between XAML and C# which allows you to manipulate the objects of your application in equivalent ways. This msdn article describes the XAML syntax and how it relates to the object oriented terminology in C#. In short you just have access the VerticalAxis property of your chart in C#, cast it to LinearAxis and set its Minimum and Maximum properties.

Regards,
Victor
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Yong Kang
Top achievements
Rank 1
answered on 22 Jun 2013, 02:16 AM
Thank you Victor, I got the problem resolved as suggested. Thanks again!
Tags
Chart
Asked by
Yong Kang
Top achievements
Rank 1
Answers by
Victor
Telerik team
Yong Kang
Top achievements
Rank 1
Share this question
or