Change a chart's axis range on click

Thread is closed for posting
2 posts, 1 answers
  1. Ashley
    Ashley avatar
    22 posts
    Member since:
    Jul 2010

    Posted 13 Aug 2010 Link to this post

    Hi all,

    I want to change the charts range when a user clicks so they can view the years before and after, to do this I think I will have to change the axis ranges by adding or subtracting 366 to them, is there any way I can achieve this I am not sure how to go about it.


  2. Answer
    Ves avatar
    2926 posts

    Posted 18 Aug 2010 Link to this post

    Hi Ashley,

    That's correct - you can directly add/subtract a certain number to axis bounds as they are numeric. The values correspond to the OLE Automation date equivalent, retrieved by the DateTime.ToOADate method. In OLE Automation date equivalent a value of 1 corresponds to a time span of 1 day, so adding/ subtracting 365/366 would do the job, but you can also use this code myDate.AddYears(1).ToOADate.

    You can find an example of manipulating X axis range with date time values here.

    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top