English
Class: D3PAxisTitle
Defined in: core/titles.ts:170
The title of an axis. On an axis of a cartesian chart it sits against the tick labels, on the outer side, gap pixels from them, wherever the axis is: with several axes on one side each has its title against its own labels (leave room for it between them, with the offset of the axes). The plot keeps the room the axis and its title need together. On the left or right it is turned to read along the axis. For an axis of a polar system, which has no side of its own, the title is against the disc: under it for an angle axis, on its left for a radius axis.
Extends
D3PAttachable<AxisTitleData>
Accessors
props
Get Signature
ts
get props(): D3PProps<D3PAxisTitleProps>;Defined in: core/titles.ts:186
The props of the axis title: its text, its alignment, its gap and its style.
Returns
Set Signature
ts
set props(v): void;Defined in: core/titles.ts:190
Merges props into those of the axis title.
Parameters
v
align?
"start" | "end" | "center"
Where it is along the axis: its start, its middle (the default) or its end.
gap?
number
Pixels between the tick labels of the axis and its title (cartesian axes).
style?
{ color?: string; fontSize?: number; fontWeight?: string; }
Color, size and weight of the text.
style.color?
string
style.fontSize?
number
style.fontWeight?
string
text?
string
Default: the display name of the axis.
Returns
void
Constructors
Constructor
ts
new D3PAxisTitle(opts): D3PAxisTitle;Defined in: core/titles.ts:178
Parameters
opts
Returns
D3PAxisTitle
Overrides
Methods
addToChart()
ts
addToChart(chart): void;Defined in: core/object.ts:77
Attaches the object to a chart; nothing happens if it already is attached to it.
Parameters
chart
Returns
void
Inherited from
attached()
ts
protected attached(
chart,
data,
subs
): void;Defined in: core/titles.ts:198
Subscribe / create DOM. Subscriptions added to subs are released on detach.
Parameters
chart
data
AxisTitleData
subs
Returns
void
Overrides
createData()
ts
protected createData(): AxisTitleData;Defined in: core/titles.ts:194
Build the per-chart record. Must not rely on other objects of the chart.
Returns
AxisTitleData
Overrides
destroy()
ts
destroy(): void;Defined in: core/object.ts:51
Detaches the object from all its charts, announces destroyed and releases its subscriptions. The object cannot be used afterwards.
Returns
void
Inherited from
detached()
ts
protected detached(_chart, data): void;Defined in: core/titles.ts:206
DOM / registry cleanup (subscriptions are released afterwards).
Parameters
_chart
data
AxisTitleData
Returns
void
Overrides
fire()
ts
protected fire<P>(event, ...args): void;Defined in: core/object.ts:41
Emits one of its own events on the bus.
Type Parameters
P
P
Parameters
event
D3PEvent<P>
args
...P extends void ? [] : [payload: P]
Returns
void
Inherited from
getCharts()
ts
getCharts(): D3PChart[];Defined in: core/object.ts:105
The charts the object is attached to.
Returns
D3PChart[]
Inherited from
hasChart()
ts
hasChart(chart): boolean;Defined in: core/object.ts:110
Whether the object is attached to this chart.
Parameters
chart
Returns
boolean
Inherited from
onDestroy()
ts
protected onDestroy(): void;Defined in: core/object.ts:114
Hook run first on destroy (detach from partners, release DOM...).
Returns
void
Inherited from
removeFromChart()
ts
removeFromChart(chart): void;Defined in: core/object.ts:95
Detaches the object from a chart; nothing happens if it is not attached to it.
Parameters
chart
Returns
void
Inherited from
render()
ts
render(chart): void;Defined in: core/titles.ts:277
Writes the title against the labels of the axis, and asks for the room it needs.
Parameters
chart
Returns
void
Overrides
tagDirty()
ts
tagDirty(chart?): void;Defined in: core/object.ts:119
Schedule a redraw on one chart (or all attached charts).
Parameters
chart?
Returns
void
Inherited from
Properties
bus
ts
readonly bus: D3PBus;Defined in: core/object.ts:27
The bus the object uses for its events.
Inherited from
chartData
ts
protected readonly chartData: Map<D3PChart, AxisTitleData>;Defined in: core/object.ts:66
What the object keeps for each chart it is attached to.
Inherited from
e
ts
readonly e: D3PEventTable<M & object>;Defined in: core/object.ts:29
The events of the object, by name: destroyed for all, and its own (axis.e.scaleChanged).
Inherited from
isDestroying
ts
isDestroying: boolean = false;Defined in: core/object.ts:31
Set when destroy starts: the object is not drawn after that.
Inherited from
subs
ts
protected readonly subs: D3PSubscriptions;Defined in: core/object.ts:33
The subscriptions of the object, released when it is destroyed.