English
Class: D3PLegendManager
Defined in: core/legend.ts:30
Computes the legend of each chart from the entries of its renderers (names, colors, visibility).
Extends
D3PAttachable<LegendData, {changed:D3PLegend; }>
Constructors
Constructor
ts
new D3PLegendManager(opts?): D3PLegendManager;Defined in: core/legend.ts:34
Parameters
opts?
Returns
D3PLegendManager
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/legend.ts:43
Subscribe / create DOM. Subscriptions added to subs are released on detach.
Parameters
chart
data
LegendData
subs
Returns
void
Overrides
createData()
ts
protected createData(): LegendData;Defined in: core/legend.ts:39
Build the per-chart record. Must not rely on other objects of the chart.
Returns
LegendData
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/legend.ts:48
DOM / registry cleanup (subscriptions are released afterwards).
Parameters
_chart
data
LegendData
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
getLegend()
ts
getLegend(chart): D3PLegend;Defined in: core/legend.ts:79
What the legend shows for a chart: an entry for each part of the renderers it lists.
Parameters
chart
Returns
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
refresh()
ts
refresh(chart): void;Defined in: core/legend.ts:84
Force the emission of the current legend of chart.
Parameters
chart
Returns
void
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 | Promise<void>;Defined in: core/object.ts:129
Draws the object on a chart. The render manager calls it, once per frame, for the objects that asked for it.
Parameters
_chart
Returns
void | Promise<void>
Inherited from
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, LegendData>;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
series
ts
readonly series:
| readonly (string | D3PSeriesRenderer<any, any>)[]
| undefined;Defined in: core/legend.ts:32
The renderers the legend is restricted to, if any.
subs
ts
protected readonly subs: D3PSubscriptions;Defined in: core/object.ts:33
The subscriptions of the object, released when it is destroyed.