I have two issues. I am not sure why my date is March 4, 4024. (That year would make us all over 2000 years old) I verified the culture that I am using is USA. This is the sample that I am using that is taking directly from the temperature example. I am using .Net 2012 4.5 Framework
Also, is there a way to show milliSeconds?
[img]graph.jpg[/img]
DateTime XAxis label is not accurate
Moderator: Queue Moderators
DateTime XAxis label is not accurate
- Attachments
-
- graph.JPG (133.52 KiB) Viewed 14250 times
Re: DateTime XAxis label is not accurate
Ok, I solved my question, with the date, and lightweight solved the millisecond issue.
To get the correct date, I added the following code:
trend.ViewXY.XAxes[0].DateOriginYear = now.Date.Year;
trend.ViewXY.XAxes[0].DateOriginMonth = now.Date.Month;
trend.ViewXY.XAxes[0].DateOriginDay = now.Date.Day;
Hope this helps
To get the correct date, I added the following code:
trend.ViewXY.XAxes[0].DateOriginYear = now.Date.Year;
trend.ViewXY.XAxes[0].DateOriginMonth = now.Date.Month;
trend.ViewXY.XAxes[0].DateOriginDay = now.Date.Day;
Hope this helps
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: DateTime XAxis label is not accurate
The DateOrigin must be set less than the date to be shown in the chart. DateOrigin is needed to be able to show microsecond-nanosecond level accuracy of date times, which goes beyond the accuracy of regular Double-precision of DateTimes in .NET.
LightningChart Support Team, PT
Re: DateTime XAxis label is not accurate
Disagree.
DateTime is in fact a double precision and can store millisecond accuracy. I stated that the millisecond is "lighweight" solved. When I implemented two markers on the chart, both the tool and .Net is able to display the double precision See the attached. My issue is that when the graph is created, it does not show milliseconds, however, the tool has been crafted to create a time graph that is synchronized with the system clock. The precision is very accurate to the second. And in fact, when I zoom in on the plot, the milliseconds are displayed. See the graph below, the times are pulled directly from the tool.
DateTime is in fact a double precision and can store millisecond accuracy. I stated that the millisecond is "lighweight" solved. When I implemented two markers on the chart, both the tool and .Net is able to display the double precision See the attached. My issue is that when the graph is created, it does not show milliseconds, however, the tool has been crafted to create a time graph that is synchronized with the system clock. The precision is very accurate to the second. And in fact, when I zoom in on the plot, the milliseconds are displayed. See the graph below, the times are pulled directly from the tool.
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: DateTime XAxis label is not accurate
I just want to explain why the DateOrigin settings in LightningChart...
If you have total X-range of 1 ms, and want to present 1 GHz sampled data, there's 1 M points in 1 ms range.
.NET DateTime uses January 1, 0001 as date origin. The integer part of the double is seconds from that. The decimal part is fractions of a seconds. When having a long time period, the integer part needs lot of bits from 64-bit double, and it doesn't leave good accuracy for decimals. It would show as irregularly spaced divisions and data points packing in same coordinates in X dimension. Trust me, we know this from experience.
LightningChart has therefore date origin shifting, the integer part of DateTime's double is then minimal, leaving more bits for decimals and enabling nano-sec precision date time axes.
If you have total X-range of 1 ms, and want to present 1 GHz sampled data, there's 1 M points in 1 ms range.
.NET DateTime uses January 1, 0001 as date origin. The integer part of the double is seconds from that. The decimal part is fractions of a seconds. When having a long time period, the integer part needs lot of bits from 64-bit double, and it doesn't leave good accuracy for decimals. It would show as irregularly spaced divisions and data points packing in same coordinates in X dimension. Trust me, we know this from experience.
LightningChart has therefore date origin shifting, the integer part of DateTime's double is then minimal, leaving more bits for decimals and enabling nano-sec precision date time axes.
LightningChart Support Team, PT