Skip to content
EliteChart

LogScale

Documentation


Documentation / @elitechart/core / LogScale

Defined in: math/scales.ts:125

Log scale over positive values. Domain must be strictly positive — non-positive values throw at construction.

Use for price axes on instruments with multi-decade range (BTC at $100 → $100k, equities tracked across IPOs).

Example

code
import { LogScale } from '@elitechart/core';
const price = new LogScale({ min: 1, max: 1000 }, { start: 600, end: 0 });
price.scale(10);   // ~400
price.scale(100);  // ~200

Implements

Constructors

Constructor

code
new LogScale(domain, range): LogScale;

Defined in: math/scales.ts:132

Parameters

domain

Domain

range

Range

Returns

LogScale

Properties

domain

code
readonly domain: Domain;

Defined in: math/scales.ts:126

Implementation of

Scale.domain


range

code
readonly range: Range;

Defined in: math/scales.ts:127

Implementation of

Scale.range

Methods

invert()

code
invert(px): number;

Defined in: math/scales.ts:152

Map a pixel back to the domain.

Parameters

px

number

Returns

number

Implementation of

Scale.invert


scale()

code
scale(value): number;

Defined in: math/scales.ts:145

Map a domain value to a pixel position.

Parameters

value

number

Returns

number

Implementation of

Scale.scale