ILabelProvider
StockSharp.Xaml.Charting.Visuals.Axes
用于定义 LabelProvider 的接口。 LabelFormatter 可能设定或数据绑定到 LabelProvider 属性, 允许程序上覆盖轴标签 。 创建一个类别, 执行 ILabelProvider 并返回 IComparable 和 Boolean 的字符串值 。
方法
CreateDataContext
public ITickLabelViewModel CreateDataContext(IComparable dataValue)
result = iLabelProvider.CreateDataContext(dataValue)
创建基于数据传递值的 ITickLabelViewModel 实例。 Invokes IComparable 用于格式化指定数据传递值。
- dataValue
- 数据值到格式
FormatCursorLabel
public string FormatCursorLabel(IComparable dataValue, bool hitTest)
result = iLabelProvider.FormatCursorLabel(dataValue, hitTest)
格式化光标的标签,从指定的数据值中转出
- dataValue
- 数据值到格式
- hitTest
- 克克击出试.
返回值: 格式化光标标签字符串
FormatLabel
public string FormatLabel(IComparable dataValue)
result = iLabelProvider.FormatLabel(dataValue)
格式化从指定的数据值中传递到的轴的标签
- dataValue
- 数据值到格式
返回值: 格式化标签字符串
Init
public void Init(IAxis parentAxis)
iLabelProvider.Init(parentAxis)
标签格式初始化时使用, 其附件为父轴, 父轴实例
- parentAxis
- 父轴实例
OnBeginAxisDraw
public void OnBeginAxisDraw()
iLabelProvider.OnBeginAxisDraw()
在轴使通过之前, 在为当前绘图操作格式化标签之前调用
UpdateDataContext
public ITickLabelViewModel UpdateDataContext(ITickLabelViewModel labelDataContext, IComparable dataValue)
result = iLabelProvider.UpdateDataContext(labelDataContext, dataValue)
根据传输的数据值更新现有的 ITickLabelViewModel。 Invokes IComparable 以格式化传输的数据值。
- labelDataContext
- 需要更新的例子
- dataValue
- 数据值到格式