ICategoryCoordinateCalculator
StockSharp.Xaml.Charting.Numerics.CoordinateCalculators
定义接口为 CategoryDateTimeAxis 特定 ICoordinateCalculator, 将像素坐标转换为索引到数据值和回数
实现: ICoordinateCalculator<double>
方法
TransformDataToIndex
public int TransformDataToIndex(DateTime dataValue)
result = iCategoryCoordinateCalculator.TransformDataToIndex(dataValue)
使用 DateTime 数据值,并在轴上转换为整数索引 e.g. 如果轴为 CategoryDateTimeAxis, 接受 DateTime, 返回索引。 如果 DateTime 位于数据范围之外, 则进行预测 。
- dataValue
- 数据值
返回值: 基础数据序列的索引
TransformDataToIndex
public int TransformDataToIndex(DateTime dataValue, SearchMode searchMode)
result = iCategoryCoordinateCalculator.TransformDataToIndex(dataValue, searchMode)
使用 DateTime 数据值,并在轴上转换为整数索引 e.g. 如果轴为 CategoryDateTimeAxis, 接受 DateTime, 返回索引。 如果 DateTime 位于数据范围之外, 则进行预测 。
- dataValue
- 数据值
- searchMode
- 表示在wich中寻找
返回值: 基础数据序列的索引,或者如果Exact和不存在的话的-1.
TransformIndexToData
public DateTime TransformIndexToData(int index)
result = iCategoryCoordinateCalculator.TransformIndexToData(index)
将整数指数(或点数)取入基础数据,然后转换为轴上的数据值。如果轴为 CategoryDateTimeAxis, 接受指数, 返回 DateTime。 如果指数位于数据范围之外, 则进行预测 。
- index
- 基础数据序列的索引
返回值: 数据值