NDataSeriesDouble convert Datetime to double algorithm


Author
Message
Craig Swearingen
Craig Swearingen
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
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.
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 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


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