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

Change a chart's axis range on click

1 Answer 42 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Ashley
Top achievements
Rank 1
Ashley asked on 13 Aug 2010, 11:12 AM
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.

regards,

Ash 

1 Answer, 1 is accepted

Sort by
0
Accepted
Ves
Telerik team
answered on 18 Aug 2010, 11:23 AM
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.

Sincerely,
Ves
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
Tags
Chart (Obsolete)
Asked by
Ashley
Top achievements
Rank 1
Answers by
Ves
Telerik team
Share this question
or