!!!###!!!title=Scale——VisActor/VGrammar api documents!!!###!!!!!!###!!!description=The syntactic element Scale can be translated as "scale".!!!###!!!

Scale

The syntactic element Scale can be translated as "scale".

Instance Methods

domain

Set the scale's domain, its ts type definition is as follows:

(domain: ScaleFunctionType<any[]> | ScaleData | Nil) => this;

range

Set the scale's range, its ts type definition is as follows:

(range: ScaleFunctionType<any[]> | ScaleData | Nil) => this;

configure

Configure the scale, its ts type definition is as follows:

(config: ScaleConfigureSpec | Nil) => this;

getScaleType

Get the scale's type, its ts type definition is as follows:

() => GrammarScaleType;

getScale

Get the scale's instance, its ts type definition is as follows:

() => IBaseScale;

ticks

Get the scale's ticks, its ts type definition is as follows:

(count?: number) => TickData[];

getCoordinateAxisPoints

Get the starting and end points of the coordinate axis corresponding to the scale, its ts type definition is as follows:

(baseValue?: number) => [IPointLike, IPointLike];

getCoordinate

Get the coordinate system corresponding to the scale, its ts type definition is as follows:

() => IPolarCoordinate | ICartesianCoordinate;

getCoordinateAxisPosition

Get the position of the coordinate axis corresponding to the scale, its ts type definition is as follows:

() => 'top' | 'bottom' | 'left' | 'right' | 'inside' | 'outside' | 'start' | 'end';

id

Set or read the unique identifier id of the component.

name

Set or read the component's name name.

depend

Set the dependent syntactic elements. Its ts type definition is as follows:

(grammar: IGrammarBase[] | IGrammarBase | string[] | string) => this;

The argument can be an instance of another syntax element, or an id corresponding to a syntax element.

clear

Clear all configurations of the current grammar element

release

Release and destroy the grammar element instance