1

Is it possible to use DateTimeOffset as the X-Axis data type in scicharts?

I've attempted creating a DataSeries of

DataSeries<DateTimeOffset,double> But get a runtime exception of

"Cannot create a DataDistributionCalculator for the type TX=System.DateTimeOffset"

on3al
  • 2,090
  • 4
  • 20
  • 19

1 Answers1

1

According to the SciChart documentation for DataSeries, supported datatypes are as follows:

NOTE: Allowable types in SciChart include DateTime, TimeSpan, Int64, Int32, Int16, Byte, Double, Float, UInt64, UInt32, UInt16, SByte.

DateTime, TimeSpan are only allowable on TX. The type Decimal (128) bit is not allowed. Custom types are not allowed.

As a result it is not possible to declare a custom type for the TX in a DataSeries or an XAxis.

However, you may be able to achieve what you want by using the LabelProvider feature. If your goal is to allow offsetting DateTime by a fixed amount then the LabelProvider lets you format strings on the XAxis using a custom rule in code.

Is that what you need?

Dr. Andrew Burnett-Thompson
  • 20,980
  • 8
  • 88
  • 178
  • 1
    The LabelProvider will do what we need for now. Our primary concern is addressing DST boundaries. Without the timezone offset, multiple points are plotted with the same X value in the current date time chart when daylight savings boundaries occur. The inability to keep timestamps as DateTimeOffsets will force us to use a numeric chart with a custom LabelProvider. Native support for DateTimeOffsets would be a welcome addition. – on3al May 18 '18 at 14:25