Profile Picture

NDataSeriesDouble convert Datetime to double algorithm

Posted By Craig Swearingen 9 Years Ago
Author
Message
Nevron Support
This post has been flagged as an answer
Posted 9 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: Yesterday @ 1:54 AM
Posts: 3,054, Visits: 4,009

Hi Craig,

You need to use the DateTime ToOADate method which converts the date time value to double:

double doubleValue = DateTime.Now.ToOADate();

Let us know if you have any questions.



Best Regards,
Nevron Support Team



Craig Swearingen
Question Posted 9 Years Ago
View Quick Profile
Supreme Being

Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 99, Visits: 654
I'm using the NDataSeriesDouble.Add(DateTime value) method since my data is in DateTime format.  On this Axis I need to add a NAxisConstLine which doesn't take a DateTime which is what my data is in.  How do I calculate the appropriate double value for the DateTime I have for my const line?

I've worked around this by inserting the double I'm looking for and then calling NDataSeriesDouble.GetDoubleValue(0) to get the double value then clearing and filling my series.  This is not ideal and I suspect I just can't find how to do something that seems is obviously needed.  I looked around but I would appreciate knowing how to do this.



Similar Topics


Reading This Topic