Skip to main content
Version: Next

Interface: TimeScaleOptions

Extended time scale options for time-based horizontal scale

Extends

Properties

rightOffset

rightOffset: number

The margin space in bars from the right side of the chart.

Default Value

0

Inherited from

HorzScaleOptions . rightOffset


rightOffsetPixels?

optional rightOffsetPixels: number

The margin space in pixels from the right side of the chart. This option has priority over rightOffset.

Default Value

undefined

Inherited from

HorzScaleOptions . rightOffsetPixels


barSpacing

barSpacing: number

The space between bars in pixels.

Default Value

6

Inherited from

HorzScaleOptions . barSpacing


minBarSpacing

minBarSpacing: number

The minimum space between bars in pixels.

Default Value

0.5

Inherited from

HorzScaleOptions . minBarSpacing


maxBarSpacing

maxBarSpacing: number

The maximum space between bars in pixels.

Has no effect if value is set to 0.

Default Value

0

Inherited from

HorzScaleOptions . maxBarSpacing


fixLeftEdge

fixLeftEdge: boolean

Prevent scrolling to the left of the first bar.

Default Value

false

Inherited from

HorzScaleOptions . fixLeftEdge


fixRightEdge

fixRightEdge: boolean

Prevent scrolling to the right of the most recent bar.

Default Value

false

Inherited from

HorzScaleOptions . fixRightEdge


lockVisibleTimeRangeOnResize

lockVisibleTimeRangeOnResize: boolean

Prevent changing the visible time range during chart resizing.

Default Value

false

Inherited from

HorzScaleOptions . lockVisibleTimeRangeOnResize


rightBarStaysOnScroll

rightBarStaysOnScroll: boolean

Prevent the hovered bar from moving when scrolling.

Default Value

false

Inherited from

HorzScaleOptions . rightBarStaysOnScroll


borderVisible

borderVisible: boolean

Show the time scale border.

Default Value

true

Inherited from

HorzScaleOptions . borderVisible


borderColor

borderColor: string

The time scale border color.

Default Value

'#2B2B43'

Inherited from

HorzScaleOptions . borderColor


visible

visible: boolean

Show the time scale.

Default Value

true

Inherited from

HorzScaleOptions . visible


timeVisible

timeVisible: boolean

Show the time, not just the date, in the time scale and vertical crosshair label.

Default Value

false

Inherited from

HorzScaleOptions . timeVisible


secondsVisible

secondsVisible: boolean

Show seconds in the time scale and vertical crosshair label in hh:mm:ss format for intraday data.

Default Value

true

Inherited from

HorzScaleOptions . secondsVisible


shiftVisibleRangeOnNewBar

shiftVisibleRangeOnNewBar: boolean

Shift the visible range to the right (into the future) by the number of new bars when new data is added.

Note that this only applies when the last bar is visible.

Default Value

true

Inherited from

HorzScaleOptions . shiftVisibleRangeOnNewBar


allowShiftVisibleRangeOnWhitespaceReplacement

allowShiftVisibleRangeOnWhitespaceReplacement: boolean

Allow the visible range to be shifted to the right when a new bar is added which is replacing an existing whitespace time point on the chart.

Note that this only applies when the last bar is visible & shiftVisibleRangeOnNewBar is enabled.

Default Value

false

Inherited from

HorzScaleOptions . allowShiftVisibleRangeOnWhitespaceReplacement


ticksVisible

ticksVisible: boolean

Draw small vertical line on time axis labels.

Default Value

false

Inherited from

HorzScaleOptions . ticksVisible


tickMarkMaxCharacterLength?

optional tickMarkMaxCharacterLength: number

Maximum tick mark label length. Used to override the default 8 character maximum length.

Default Value

undefined

Inherited from

HorzScaleOptions . tickMarkMaxCharacterLength


uniformDistribution

uniformDistribution: boolean

Changes horizontal scale marks generation. With this flag equal to true, marks of the same weight are either all drawn or none are drawn at all.

Inherited from

HorzScaleOptions . uniformDistribution


minimumHeight

minimumHeight: number

Define a minimum height for the time scale. Note: This value will be exceeded if the time scale needs more space to display it's contents.

Setting a minimum height could be useful for ensuring that multiple charts positioned in a horizontal stack each have an identical time scale height, or for plugins which require a bit more space within the time scale pane.

Default Value

0

Inherited from

HorzScaleOptions . minimumHeight


allowBoldLabels

allowBoldLabels: boolean

Allow major time scale labels to be rendered in a bolder font weight.

Default Value

true

Inherited from

HorzScaleOptions . allowBoldLabels


ignoreWhitespaceIndices

ignoreWhitespaceIndices: boolean

Ignore time scale points containing only whitespace (for all series) when drawing grid lines, tick marks, and snapping the crosshair to time scale points.

For the yield curve chart type it defaults to true.

Default Value

false

Inherited from

HorzScaleOptions . ignoreWhitespaceIndices


enableConflation

enableConflation: boolean

Enable data conflation for performance optimization when bar spacing is very small. When enabled, multiple data points are automatically combined into single points when they would be rendered in less than 0.5 pixels of screen space. This significantly improves rendering performance for large datasets when zoomed out.

Default Value

false

Inherited from

HorzScaleOptions . enableConflation


conflationThresholdFactor?

optional conflationThresholdFactor: number

Smoothing factor for conflation thresholds. Controls how aggressively conflation is applied. This can be used to create smoother-looking charts, especially useful for sparklines and small charts.

  • 1.0 = conflate only when display can't show detail (default, performance-focused)
  • 2.0 = conflate at 2x the display threshold (moderate smoothing)
  • 4.0 = conflate at 4x the display threshold (strong smoothing)
  • 8.0+ = very aggressive smoothing for very small charts

Higher values result in fewer data points being displayed, creating smoother but less detailed charts. This is particularly useful for sparklines and small charts where smooth appearance is prioritized over showing every data point.

Note: Should be used with continuous series types (line, area, baseline) for best visual results. Candlestick and bar series may look less natural with high smoothing factors.

Default Value

1.0

Inherited from

HorzScaleOptions . conflationThresholdFactor


precomputeConflationOnInit

precomputeConflationOnInit: boolean

Precompute conflation chunks for common levels right after data load. When enabled, the system will precompute conflation data for standard factors (2, 5, 10, 25, 50, 100, 200, 300) in the background, which improves performance when zooming out but increases initial load time and memory usage.

Performance impact:

  • Initial load: +100-500ms depending on dataset size
  • Memory usage: +20-50% of original dataset size
  • Zoom performance: Significant improvement (10-100x faster)

Recommended for: Large datasets (>10K points) on machines with sufficient memory Precompute conflation chunks for common levels right after data load.

Default Value

false

Inherited from

HorzScaleOptions . precomputeConflationOnInit


precomputeConflationPriority

precomputeConflationPriority: "background" | "user-visible" | "user-blocking"

Priority used for background precompute tasks when the Prioritized Task Scheduling API is available.

Options:

  • 'background': Lowest priority, tasks run only when the browser is idle
  • 'user-visible': Medium priority, tasks run when they might affect visible content
  • 'user-blocking': Highest priority, tasks run immediately and may block user interaction

Recommendation: Use 'background' for most cases to avoid impacting user experience. Only use higher priorities if conflation is critical for your application's functionality.

Default Value

'background'

Inherited from

HorzScaleOptions . precomputeConflationPriority


tickMarkFormatter?

optional tickMarkFormatter: TickMarkFormatter

Tick marks formatter can be used to customize tick marks labels on the time axis.

Default Value

undefined