Skip to content

createYAxis(yAxis)

createYAxis create y-axis.

Reference

typescript
(
  yAxis: {
    paneId?: string
    id?: string
    name?: string
    reverse?: boolean
    inside?: boolean
    needWidget?: boolean
    position?: 'left' | 'right'
    scrollZoomEnabled?: boolean
    gap?: {
      top?: number
      bottom?: number
    }
    createRange?: (params: object) => ({
      from: number
      to: number
      range: number
      realFrom: number
      realTo: number
      realRange: number
      displayFrom: number
      displayTo: number
      displayRange: number
    })
    createTicks?: (params: object) => Array<{
      coord: number
      value: number | string
      text: string
    }>
  }
) => string | null

Parameters

  • yAxis Y-axis configuration.
    • paneId Pane id. Defaults to the candle pane.
    • id Y-axis id.
    • name Axis name.
    • reverse Whether to reverse.
    • inside Whether to place inside.
    • needWidget Whether to create an axis widget.
    • position Position, supports left and right.
    • scrollZoomEnabled Whether scrolling and zooming are enabled on the Y-axis. When enabled, users can drag to scroll the axis or use the mouse wheel to zoom.
    • gap Top and bottom margin configuration.
      • top Top margin.
      • bottom Bottom margin.
    • createRange Callback for creating the value range on the axis.
    • createTicks Callback for creating tick information.

Returns

createYAxis returns the created y-axis id, or null if creation fails.

Usage

Basic usage