Profile Picture

set begin and end value for DateTime scale

Posted By Manal Goyal 6 Years Ago
Author
Message
Manal Goyal
Question Posted 6 Years Ago
View Quick Profile
Forum Member

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
Last Active: 5 Years Ago
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
This post has been flagged as an answer
Posted 6 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: 13 hours ago
Posts: 3,054, Visits: 4,009

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





Similar Topics


Reading This Topic