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

3 posts, 0 answers
  1. Yong Kang
    Yong Kang  avatar
    2 posts
    Member since:
    Oct 2012

    Posted 19 Jun 2013 Link to this post

    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. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 21 Jun 2013 Link to this post

    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.
  3. DevCraft banner
  4. Yong Kang
    Yong Kang  avatar
    2 posts
    Member since:
    Oct 2012

    Posted 21 Jun 2013 Link to this post

    Thank you Victor, I got the problem resolved as suggested. Thanks again!
Back to Top