Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

Properties

Protected colorProperty

colorProperty: string

dataLabels

dataLabels: TDataLabel[] = []

The text to draw, along with the sizes and positions. Usually generated, but can be set or updated before final drawing

drawImmediate

drawImmediate: boolean = false

Draws immediately, set this True when using sub-surfaces for proper data label layering

Protected engineeringPrefixProperty

engineeringPrefixProperty: IEngineeringPrefix

getClipRect

getClipRect: ((renderPassData: RenderPassData) => Rect) | undefined

When set, this provider's labels are drawn immediately after generation (during the series draw), clipped to the returned rect (surface coordinates), instead of in the deferred global text pass. See IBaseDataLabelProviderOptions.getClipRect

Protected horizontalTextPositionProperty

horizontalTextPositionProperty: EHorizontalTextPosition = EHorizontalTextPosition.Right

Protected isEnabledProperty

isEnabledProperty: boolean = true

metaDataSelector

metaDataSelector: (metadata: IPointMetadata) => string

If this is set it will be used to get text values from metaData, rather than formatting y values. The selector will be called even if the metaData for an index is undefined.

Type declaration

Protected numericFormatProperty

numericFormatProperty: ENumericFormat = undefined

undefined until explicitly set, which is what distinguishes "the caller asked for nothing" from "the caller asked for Decimal". Only that distinction lets an unset provider fall back to the column-type default while an explicit setting still wins. The PUBLIC numericFormat getter resolves it to a concrete value, so the sentinel never leaves this class.

Protected parentSeries

parentSeries: IRenderableSeries

The Parent RenderableSeries

Protected pointCountThresholdProperty

pointCountThresholdProperty: number = Infinity

Protected pointGapThresholdProperty

pointGapThresholdProperty: number = 0

Protected precisionProperty

precisionProperty: number = undefined

undefined until explicitly set - see numericFormatProperty.

Protected skipModeProperty

skipModeProperty: EDataLabelSkipMode = EDataLabelSkipMode.SkipIfOverlapPrevious

Protected skipNumberProperty

skipNumberProperty: number = 0

Protected state

Protected styleProperty

styleProperty: TDataLabelStyle

Protected textBounds

textBounds: TSRTextBounds

Reusable native text-bounds buffer, allocated once at attach time. Hoisted here so allocation never happens on the render path — first-time native allocation can grow the WASM heap and detach any Float64Array views captured earlier in the same frame (e.g. inside a DataLabelState).

Protected textColumnProperty

textColumnProperty: string = undefined

Readonly type

type: EDataLabelProviderType = EDataLabelProviderType.Line

updateTextInAnimation

updateTextInAnimation: boolean = false

Whether the label text should update when the label position is animating. Default false.

Protected verticalTextPositionProperty

verticalTextPositionProperty: EVerticalTextPosition = EVerticalTextPosition.Above

Protected webAssemblyContext

webAssemblyContext: TSciChart

The SciChart 2D WebAssembly Context containing native methods and access to our WebGL2 Engine and WebAssembly numerical methods

ySelector

ySelector: (ps: IPointSeries) => SCRTDoubleVector

A function to pick which y values to use from the pointSeries passed in on the renderPassData

Type declaration

Static Protected Readonly DEFAULT_NUMERIC_FORMAT

DEFAULT_NUMERIC_FORMAT: Decimal = ENumericFormat.Decimal

The value numericFormat reports, and the last resort in resolveFormat.

Static Protected Readonly DEFAULT_PRECISION

DEFAULT_PRECISION: 1 = 1

The value precision reports, and the last resort in resolveFormat.

Accessors

aboveBelow

  • get aboveBelow(): boolean
  • set aboveBelow(value: boolean): void
  • Gets or Sets whether text should be positioned above the line if it is going down, and below the line if it going up. Default true. When true this overrides horizontalAnchorPoint and verticalAnchorPoint to be left, bottom.

    Returns boolean

  • Gets or Sets whether text should be positioned above the line if it is going down, and below the line if it going up. Default true. When true this overrides horizontalAnchorPoint and verticalAnchorPoint to be left, bottom.

    Parameters

    • value: boolean

    Returns void

color

  • get color(): string
  • set color(value: string): void
  • Gets or sets the color for data labels. Defaults to axis label color

    Returns string

  • Gets or sets the color for data labels. Defaults to axis label color

    Parameters

    • value: string

    Returns void

engineeringPrefix

horizontalTextPosition

isEnabled

  • get isEnabled(): boolean
  • set isEnabled(value: boolean): void
  • Flag to enable/disable dataLabel generation. Default true

    Returns boolean

  • Flag to enable/disable dataLabel generation. Default true

    Parameters

    • value: boolean

    Returns void

numericFormat

  • Gets or sets numeric format to use when formatting values to text. For a list of values, see ENumericFormat For more control, override getText

    remarks

    Reports ENumericFormat.Decimal while unset, but an UNSET provider defers to the formatted column's declared EColumnType first — see resolveFormat. Setting this (to Decimal included) pins it and beats the column type.

    Returns ENumericFormat

  • Gets or sets numeric format to use when formatting values to text. For a list of values, see ENumericFormat For more control, override getText

    remarks

    Reports ENumericFormat.Decimal while unset, but an UNSET provider defers to the formatted column's declared EColumnType first — see resolveFormat. Setting this (to Decimal included) pins it and beats the column type.

    Parameters

    Returns void

pointCountThreshold

  • get pointCountThreshold(): number
  • set pointCountThreshold(value: number): void
  • Gets or sets the number of points below which drawing will start. Default Infinity This can be used instead of pointGapThreshold when data is unevenly spaced or has large y variation

    Returns number

  • Gets or sets the number of points below which drawing will start. Default Infinity This can be used instead of pointGapThreshold when data is unevenly spaced or has large y variation

    Parameters

    • value: number

    Returns void

pointGapThreshold

  • get pointGapThreshold(): number
  • set pointGapThreshold(value: number): void
  • Gets or sets the zoom threshold above which label drawing will start. Default 0. This is expressed as the gap between the first points divided by the size of the first text If data is unevenly spaced, consider pointCountThreshold or override shouldDrawText

    Returns number

  • Gets or sets the zoom threshold above which label drawing will start. Default 0. This is expressed as the gap between the first points divided by the size of the first text If data is unevenly spaced, consider pointCountThreshold or override shouldDrawText

    Parameters

    • value: number

    Returns void

precision

  • get precision(): number
  • set precision(value: number): void
  • Gets or sets the precision to use when formatting values to text For more control, override getText

    remarks

    Reports 1 while unset, but an UNSET provider defers to the formatted column's declared EColumnType first — see resolveFormat. Setting this pins it.

    Returns number

  • Gets or sets the precision to use when formatting values to text For more control, override getText

    remarks

    Reports 1 while unset, but an UNSET provider defers to the formatted column's declared EColumnType first — see resolveFormat. Setting this pins it.

    Parameters

    • value: number

    Returns void

skipMode

skipNumber

  • get skipNumber(): number
  • set skipNumber(value: number): void
  • The number of points to skip while generating labels. Default 0 = no skip. 1 = skip every other. When creating text with many data points, it will help performance to skip points rather than creating and checking overlap for every data point.

    Returns number

  • The number of points to skip while generating labels. Default 0 = no skip. 1 = skip every other. When creating text with many data points, it will help performance to skip points rather than creating and checking overlap for every data point.

    Parameters

    • value: number

    Returns void

style

  • Gets or sets the text style used for data labels. The style must be set, with fontFamily and fontSize set, in order for text to be drawn.

    Returns TDataLabelStyle

  • Gets or sets the text style used for data labels. The style must be set, with fontFamily and fontSize set, in order for text to be drawn.

    Parameters

    Returns void

textColumn

  • get textColumn(): string
  • set textColumn(value: string): void
  • Gets or sets the name of a string column on the parent series' DataSeries to take label text from, instead of formatting y values. See IBaseDataSeriesOptions.stringColumns. Takes precedence over metaDataSelector; setting both is a configuration error and warns once. An unknown column name is ignored, falling through to the other text sources. For more control, override getText.

    Returns string

  • Gets or sets the name of a string column on the parent series' DataSeries to take label text from, instead of formatting y values. See IBaseDataSeriesOptions.stringColumns. Takes precedence over metaDataSelector; setting both is a configuration error and warns once. An unknown column name is ignored, falling through to the other text sources. For more control, override getText.

    Parameters

    • value: string

    Returns void

Protected useRotation

  • get useRotation(): boolean

verticalTextPosition

Methods

delete

  • delete(): void
  • Returns void

draw

drawClipped

  • Draws this provider's labels immediately, clipped to the given rect (surface coordinates). Pre-flushes any pending font batches under the state they expect (identity transform + surface clip) so the clip cannot apply to text batched by others, then sets the label clip and force-ends the font so the clip applies to exactly this provider's labels, then restores the seriesViewRect transform + clip.

    Parameters

    Returns void

Protected drawLabels

generateDataLabels

getColor

getDataLabelState

Protected getLineSpacing

  • getLineSpacing(): number

Protected getPadding

getPosition

  • getPosition(state: DataLabelState, textBounds: TSRTextBounds): { position: Point; rotationAngle: number; rotationCenter: Point }
  • Parameters

    Returns { position: Point; rotationAngle: number; rotationCenter: Point }

    • position: Point
    • rotationAngle: number
    • rotationCenter: Point

Protected getPositionForPoint

  • getPositionForPoint(x: number, y: number, textBounds: TSRTextBounds): { position: Point; rotationAngle: number; rotationCenter: Point }
  • Parameters

    • x: number
    • y: number
    • textBounds: TSRTextBounds

    Returns { position: Point; rotationAngle: number; rotationCenter: Point }

    • position: Point
    • rotationAngle: number
    • rotationCenter: Point

getText

  • Applies numeric format to current yValue

    Parameters

    Returns string

Protected horizontalTextPositionToAnchorPoint

Protected invalidateParent

  • invalidateParent(): void

onAttach

onDetach

  • onDetach(): void
  • Returns void

resolveAutoColors

  • resolveAutoColors(index: number, maxSeries: number, theme: IThemeProvider): void

Protected resolveColumnType

  • Resolves the declared EColumnType of the data-series column whose values this provider is turning into text, or undefined when there is none. Supplies the formatting DEFAULT that an unset numericFormat/precision (or labelFormat/labelPrecision) falls back to — see DEFAULT_FORMAT_FOR_COLUMN_TYPE. An explicit setting always wins over it.

    getColumnType is optional-called as a CAPABILITY, matching how getTextAt is reached on this path: any DataSeries able to declare column types serves one, and anything else (a plain XyDataSeries, a third-party IDataSeries) simply falls through to the class default.

    Parameters

    • parentSeries: IRenderableSeries

      the renderable series the labels are being drawn for

    • Optional field: string | number

      the column the provider was explicitly pointed at (a name, or an index into valueNames), or undefined to use the series' own y selection

    Returns EColumnType | undefined

Protected resolveFormat

Protected resolveSourceIndex

  • Maps the ordinal currently being drawn (DataLabelState.index) to the row of the parent DataSeries it came from.

    The default composes the two mappings the way DataLabelState.getMetaData does - flip FIRST (getIndexInternal, which reverses the window on a non-flipped X axis), then map through the point series' indexes (which is non-identity once the data is resampled). That is the order the label's own DataLabelState.xVal/DataLabelState.yVal use, so text and coordinates always name the same row.

    Override this in a provider whose drawn ordinals do not follow that convention - see StackedColumnSeriesDataLabelProvider - so that text sources resolve against the same row the provider's own getPosition places the label on.

    Parameters

    Returns number

shouldGenerate

shouldSkipLabel

  • Called before adding a new label to state. If True the label will not be rendered.

    Parameters

    Returns boolean

toJSON

updateStyle

  • Update the style. Only the properties passed will be updated

    Parameters

    Returns void

Protected verticalTextPositionToAnchorPoint

Generated using TypeDoc