Skip to content

charton API


charton API / @chart-on/core / index / AutoscaleRule

Interface: AutoscaleRule ​

Defined in: packages/core/src/scales.ts:399

How a scale adjusts the range it fits to the data, before margins. Prices in every mode, like fixedRange. Applied in this order: include, minSpan, centerOn. Only while there is visible data to fit.

Properties ​

centerOn? ​

optional centerOn?: number

Defined in: packages/core/src/scales.ts:401

Keep this price in the middle, e.g. 0 for an oscillator around zero. Log scales center on a ratio, and skip values at or below zero.


include? ​

optional include?: number[]

Defined in: packages/core/src/scales.ts:403

Prices the range always reaches, e.g. a target level. Log scales skip values at or below zero.


minSpan? ​

optional minSpan?: number

Defined in: packages/core/src/scales.ts:405

Smallest price span to fit, so flat data does not zoom into noise. The range widens around its middle.