Search code examples
scichart

DateTimeOffset Support in Scichart


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"


Solution

  • 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?