Skip to content

Interface: D3PAxisOptions ​

Defined in: core/axis.ts:56

Options of an axis: its name, its domain, its position, its offset, the system it is in, its renderer, its scale type and options, and its props.

Properties ​

bus? ​

ts
bus?: D3PBus;

Defined in: core/axis.ts:58

The bus the axis uses (the global bus by default).


domain ​

ts
domain: D3PAxisDomain;

Defined in: core/axis.ts:62

The domain the axis reads. Axes (of any chart) that share a domain move together.


name ​

ts
name: string;

Defined in: core/axis.ts:60

Identifier in the axis manager, tool filters and mapped coordinates.


offset? ​

ts
offset?: number;

Defined in: core/axis.ts:74

Pixels between the plot and a side axis (default 0): several axes on one side stack up by giving each a larger offset, outward (left and top axes move left and up, right and bottom axes right and down). Leave room for them with the chart's margins.


position? ​

ts
position?: D3PAxisPosition;

Defined in: core/axis.ts:67

Default bottom. The component (x/y) and the default coordinate system (cartesian for the four sides, polar for angle/radius) are deduced from it.


props? ​

ts
props?: object;

Defined in: core/axis.ts:82

Initial props of the axis.

displayName? ​

ts
displayName?: string;

The name the axis shows (the text of its title): the name of the axis by default.

grid? ​

ts
grid?: object;

The grid drawn from the ticks.

grid.enabled? ​
ts
enabled?: boolean;

Whether the grid is drawn.

grid.opacity? ​
ts
opacity?: number;

Opacity of the grid lines (0 to 1).

grid.stroke? ​
ts
stroke?: string;

Color of the grid lines.

grid.strokeDasharray? ​
ts
strokeDasharray?: string;

Dash of the grid lines, as an SVG stroke-dasharray ('2,2').

grid.strokeWidth? ​
ts
strokeWidth?: number;

Width of the grid lines, in pixels.

postProcess? ​

ts
postProcess?: (group) => void;

Called after each draw with the axis group, to customize the SVG.

Parameters ​
group ​

Selection<SVGGElement, unknown, null, undefined>

Returns ​

void

tickCount? ​

ts
tickCount?: number;

The number of ticks wanted (d3 may give a few more or less).

tickFormat? ​

ts
tickFormat?: ((v) => string) | null;

Writes a value, for the ticks and the labels of the cursor and the tooltip. null: the default format of the scale. A cursor label is not a tick: round its value.


renderer? ​

ts
renderer?: D3PAxisRenderer;

Defined in: core/axis.ts:76

How the axis is drawn; default after the position. Throws if it does not support the position.


scaleOptions? ​

ts
scaleOptions?: D3PScaleOptions;

Defined in: core/axis.ts:80

Options of the scale: the base of a log scale, the exponent of a power scale.


scaleType? ​

ts
scaleType?: D3PScaleType;

Defined in: core/axis.ts:78

The type of scale (linear by default; band for categories, time for dates).


system? ​

ts
system?: string;

Defined in: core/axis.ts:69

Name of the coordinate system on the chart; default cartesian or polar after the position.