In a project using LightningChartUltimate v8.4.1, I have a requirement to import and chart some data coming from CSV files. The X-Axis is DateTime data and includes resolution to microseconds.
The problem I'm having is no matter what I do, I can't get the chart's X-Axis to properly display any sub-second data. Everything smaller than a second displays as zeros. See image.
Looking at doc and other forum entries that are somewhat related, it seems like I should be able to display label values down to microseconds.
Here's the general approach I am taking:
Code: Select all
xAxis.AutoFormatLabels = false;
xAxis.ValueType = AxisValueType.DateTime;
//xAxis.ValueType = AxisValueType.Time; //I tried Time and DateTime; no noticeable change
xAxis.LabelsTimeFormat = "HH:mm:ss.ffffff";
Before SetDateOrigin is reset...
actualDateTime: 07:02:52.077011
actualDateTimeToAxisValue 425718172.077011
actualAxisValueToDateTime: 07:02:52.077011
XAxes[0].ValueType: DateTime
XAxes[0].LabelsTimeFormat: HH:mm:ss.ffffff
XAxes[0].DateOriginYear: 2010
XAxes[0].DateOriginMonth: 1
XAxes[0].DateOriginDay: 1
XAxes[0].DateTimeRange: 2010-01-01T00:00:00.0000000-05:00;2010-01-01T00:00:10.0000000-05:00
Then I set DateOrigin to the first/lowest value for the chart:
Code: Select all
_chart.ViewXY.XAxes[0].SetDateOrigin(firstDateTime);
actualDateTime: 07:02:52.077011
actualDateTimeToAxisValue 425718172.077011
actualAxisValueToDateTime: 07:02:52.077011
XAxes[0].ValueType: DateTime
XAxes[0].LabelsTimeFormat: HH:mm:ss.ffffff
XAxes[0].DateOriginYear: 2023
XAxes[0].DateOriginMonth: 6
XAxes[0].DateOriginDay: 29
XAxes[0].DateTimeRange: 2023-06-29T00:00:00.0000000-04:00;2023-06-29T00:00:10.0000000-04:00
Then I roll through the CSV (10 seconds of data), and add it to the chart. Actually there are a handful of yAxes in the chart (PointLineSeries), but that is not relevant to this issue.
Again, the X-Axis displays all zeros for sub-second values, even though I can see in the debugger that the data points have X values with resolution to microseconds. The rest of the chart looks as expected.
What am I missing?
As a secondary question... what is the difference between AxisValueType.DateTime and AxisValueType.Time, and when would I choose one over the other?
Thanks,