set begin and end value for DateTime scale


Author
Message
Manal Goyal
Manal Goyal
Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)
Group: Forum Members
Posts: 29, Visits: 405
Hi,

I have date time scale on x axis, and I want to give user a option to select a specific time span, for that I am thinking to restrict the x axis to a certain begin and end values, but I dont know hoe can I do that. is it possible? Please let me know the solution to my problem.

Thanks and regards
Manal

Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hi Manal,
Yes it is possible to restrict the range of any axis in the control. Since date times in Nevron Chart are internally represented by double values (their OA equivalent) you need to convert the start / end date time to OA Date Time format. The following code shows how to do that:

DateTime dtEnd = DateTime.Now;
DateTime dtBegin = dtEnd - new TimeSpan(12, 0, 0);

chart.Axis(StandardAxis.PrimaryX).View = new NRangeAxisView(new NRange1DD(dtBegin.ToOADate(), dtEnd.ToOADate()), true, true);

Hope this helps - let us know if you meet any problems or have any questions.



Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search