Skip to content

Class: D3PCartesianAxisRenderer ​

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

A straight axis along a side of the plot, with its ticks, its labels and its grid. It draws the axes bottom, top, left and right of a cartesian system.

Extends ​

Constructors ​

Constructor ​

ts
new D3PCartesianAxisRenderer(): D3PCartesianAxisRenderer;

Returns ​

D3PCartesianAxisRenderer

Inherited from ​

D3PAxisRenderer.constructor

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

Inherited from ​

D3PAxisRenderer.assertSystem


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

Inherited from ​

D3PAxisRenderer.attach


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

Inherited from ​

D3PAxisRenderer.bind


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

Inherited from ​

D3PAxisRenderer.detach


draw() ​

ts
draw(ctx): void;

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

Draws a straight axis along a side of the plot, with its ticks, its labels and its grid.

Parameters ​

ctx ​

D3PAxisDrawContext

Returns ​

void

Overrides ​

D3PAxisRenderer.draw


translation() ​

ts
translation(
   axis, 
   chart, 
   offset
): object;

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

Translation of the axis group inside the inner area.

Parameters ​

axis ​

D3PAxis

chart ​

D3PChart

offset ​

number

Returns ​

object

x ​
ts
x: number;
y ​
ts
y: number;

Properties ​

name ​

ts
readonly name: "D3PCartesianAxisRenderer" = 'D3PCartesianAxisRenderer';

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

The name of the renderer, for error messages.

Overrides ​

D3PAxisRenderer.name


positions ​

ts
readonly positions: readonly ["bottom", "top", "left", "right"];

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

The positions of axes the renderer can draw.

Overrides ​

D3PAxisRenderer.positions


systemKinds ​

ts
readonly systemKinds: readonly ["cartesian"];

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

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

Overrides ​

D3PAxisRenderer.systemKinds