Skip to content

Abstract Class: D3PAxisRenderer ​

Defined in: core/axis-renderer.ts:57

Draws an axis. The axis keeps the domain and the scale; its renderer decides how they look: on a side of the chart, as a ring, along a spoke that follows the pointer...

A renderer declares the axis positions and the kinds of coordinate system it supports; the axis refuses it with an explicit error otherwise. One renderer instance serves one axis.

Extended by ​

Constructors ​

Constructor ​

ts
new D3PAxisRenderer(): D3PAxisRenderer;

Returns ​

D3PAxisRenderer

Methods ​

assertSystem() ​

ts
assertSystem(axis, system): void;

Defined in: core/axis-renderer.ts:80

Checks the coordinate system the axis ended up in.

Parameters ​

axis ​

D3PAxis

system ​

D3PCoordinateSystem

Returns ​

void


attach()? ​

ts
attach?(ctx): void;

Defined in: core/axis-renderer.ts:89

Called when the axis joins a chart: subscribe to what the drawing depends on, and use redraw.

Parameters ​

ctx ​

D3PAxisAttachContext

Returns ​

void


bind() ​

ts
bind(axis): void;

Defined in: core/axis-renderer.ts:67

Called by the axis when it is built with this renderer.

Parameters ​

axis ​

D3PAxis

Returns ​

void


detach()? ​

ts
detach?(chart): void;

Defined in: core/axis-renderer.ts:91

Called when the axis leaves a chart: release what attach took.

Parameters ​

chart ​

D3PChart

Returns ​

void


draw() ​

ts
abstract draw(ctx): void;

Defined in: core/axis-renderer.ts:93

Draws the axis: its line, its ticks, its labels, and its grid when ctx.gridGroup is given.

Parameters ​

ctx ​

D3PAxisDrawContext

Returns ​

void

Properties ​

name ​

ts
abstract readonly name: string;

Defined in: core/axis-renderer.ts:59

The name of the renderer, for error messages.


positions ​

ts
abstract readonly positions: readonly D3PAxisPosition[];

Defined in: core/axis-renderer.ts:61

The positions of axes the renderer can draw.


systemKinds ​

ts
abstract readonly systemKinds: readonly string[];

Defined in: core/axis-renderer.ts:63

The kinds of coordinate system the renderer can draw in (cartesian, polar).