是否可以在 scicharts 中使用 DateTimeOffset 作为 X 轴数据类型?
我试图创建一个 DataSeries
DataSeries<DateTimeOffset,double>
但是得到一个运行时异常
“无法为 TX=System.DateTimeOffset 类型创建 DataDistributionCalculator”
是否可以在 scicharts 中使用 DateTimeOffset 作为 X 轴数据类型?
我试图创建一个 DataSeries
DataSeries<DateTimeOffset,double>
但是得到一个运行时异常
“无法为 TX=System.DateTimeOffset 类型创建 DataDistributionCalculator”
根据 DataSeries 的SciChart 文档,支持的数据类型如下:
注意:SciChart 中允许的类型包括 DateTime、TimeSpan、Int64、Int32、Int16、Byte、Double、Float、UInt64、UInt32、UInt16、SByte。
DateTime、TimeSpan 仅允许在 TX 上使用。不允许使用 Decimal (128) 类型位。不允许自定义类型。
因此,无法在 DataSeries 或 XAxis 中为 TX 声明自定义类型。
但是,您可以通过使用LabelProvider 功能来实现您想要的。如果您的目标是允许将 DateTime 偏移一个固定量,那么 LabelProvider 允许您使用代码中的自定义规则格式化 XAxis 上的字符串。
那是你需要的吗?