Skip to content

Class: D3PLineRenderer ​

Defined in: core/renderers/line.ts:17

A line through the points of a series, in any coordinate system. The style gives its color, its width, its curve and what to do with missing values.

Extends ​

Accessors ​

color ​

Get Signature ​

ts
get color(): string;

Defined in: core/renderers/base.ts:194

The color of the renderer: the one in its style, or the one its name gives.

Returns ​

string

Inherited from ​

D3PPathRenderer.color


marker ​

Get Signature ​

ts
get marker(): D3PMarker | undefined;

Defined in: core/renderers/base.ts:140

What shows the point under the pointer; undefined for none.

Returns ​

D3PMarker | undefined

Set Signature ​

ts
set marker(m): void;

Defined in: core/renderers/base.ts:144

Replaces the marker, or removes it with undefined.

Parameters ​
m ​

D3PMarker | undefined

Returns ​

void

Inherited from ​

D3PPathRenderer.marker


props ​

Get Signature ​

ts
get props(): D3PProps<P & object>;

Defined in: core/renderers/base.ts:159

The props of the renderer: its style, what its type adds, and visible.

Returns ​

D3PProps<P & object>

Set Signature ​

ts
set props(v): void;

Defined in: core/renderers/base.ts:163

Merges props into those of the renderer; it is drawn again, with a transition.

Parameters ​
v ​

DeepPartial<P & object>

Returns ​

void

Inherited from ​

D3PPathRenderer.props


series ​

Get Signature ​

ts
get series(): D3PSeries;

Defined in: core/renderers/base.ts:168

The series the renderer draws.

Returns ​

D3PSeries

Set Signature ​

ts
set series(s): void;

Defined in: core/renderers/base.ts:172

Changes the series: the renderer is drawn again.

Parameters ​
s ​

D3PSeries

Returns ​

void

Inherited from ​

D3PPathRenderer.series


visible ​

Get Signature ​

ts
get visible(): boolean;

Defined in: core/renderers/base.ts:183

Whether the renderer is shown.

Returns ​

boolean

Set Signature ​

ts
set visible(v): void;

Defined in: core/renderers/base.ts:187

Shows or hides the renderer, with a transition.

Parameters ​
v ​

boolean

Returns ​

void

Inherited from ​

D3PPathRenderer.visible

Constructors ​

Constructor ​

ts
new D3PLineRenderer(opts): D3PLineRenderer;

Defined in: core/renderers/line.ts:20

Parameters ​

opts ​

D3PSeriesRendererOptions<D3PLineProps>

Returns ​

D3PLineRenderer

Overrides ​

D3PPathRenderer.constructor

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 ​

D3PChart

Returns ​

void

Inherited from ​

D3PPathRenderer.addToChart


attached() ​

ts
protected attached(
   chart, 
   data, 
   subs
): void;

Defined in: core/renderers/base.ts:295

Subscribe / create DOM. Subscriptions added to subs are released on detach.

Parameters ​

chart ​

D3PChart

data ​

D3PRendererChartData<D3PPathData>

subs ​

D3PSubscriptions

Returns ​

void

Inherited from ​

D3PPathRenderer.attached


baseColumn() ​

ts
protected baseColumn(): string | undefined;

Defined in: core/renderers/path.ts:90

Column holding the base of each point (an area between two curves), if any.

Returns ​

string | undefined

Inherited from ​

D3PPathRenderer.baseColumn


chartAdded() ​

ts
protected chartAdded(chart, data): void;

Defined in: core/renderers/path.ts:109

Called when the renderer is attached to a chart, to create what it draws with.

Parameters ​

chart ​

D3PChart

data ​

D3PPathData

Returns ​

void

Inherited from ​

D3PPathRenderer.chartAdded


chartRemoved() ​

ts
protected chartRemoved(_chart, data): void;

Defined in: core/renderers/path.ts:113

Called when the renderer leaves a chart, to remove what it created.

Parameters ​

_chart ​

D3PChart

data ​

D3PPathData

Returns ​

void

Inherited from ​

D3PPathRenderer.chartRemoved


checkColumns() ​

ts
protected checkColumns(series?): void;

Defined in: core/renderers/base.ts:255

Throws when the series lacks a column this renderer reads.

Parameters ​

series? ​

D3PSeries = ...

Returns ​

void

Inherited from ​

D3PPathRenderer.checkColumns


createData() ​

ts
protected createData(chart): D3PRendererChartData<D3PPathData>;

Defined in: core/renderers/base.ts:291

Build the per-chart record. Must not rely on other objects of the chart.

Parameters ​

chart ​

D3PChart

Returns ​

D3PRendererChartData<D3PPathData>

Inherited from ​

D3PPathRenderer.createData


createGroup() ​

ts
protected createGroup(chart): Group;

Defined in: core/renderers/base.ts:420

Create the renderer's own group in the middle data layer.

Parameters ​

chart ​

D3PChart

Returns ​

Group

Inherited from ​

D3PPathRenderer.createGroup


createMarker() ​

ts
createMarker(): D3PMarker;

Defined in: core/renderers/path.ts:71

The marker this kind of renderer has by default (none unless overridden).

Returns ​

D3PMarker

Inherited from ​

D3PPathRenderer.createMarker


createRendererData() ​

ts
protected createRendererData(chart): D3PPathData;

Defined in: core/renderers/path.ts:105

Creates what the renderer keeps for a chart.

Parameters ​

chart ​

D3PChart

Returns ​

D3PPathData

Inherited from ​

D3PPathRenderer.createRendererData


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 ​

D3PPathRenderer.destroy


detached() ​

ts
protected detached(chart, data): void;

Defined in: core/renderers/base.ts:306

DOM / registry cleanup (subscriptions are released afterwards).

Parameters ​

chart ​

D3PChart

data ​

D3PRendererChartData<D3PPathData>

Returns ​

void

Inherited from ​

D3PPathRenderer.detached


entriesChanged() ​

ts
protected entriesChanged(): void;

Defined in: core/renderers/base.ts:210

Announce that legendEntries() changed (the legend refreshes).

Returns ​

void

Inherited from ​

D3PPathRenderer.entriesChanged


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 ​

D3PPathRenderer.fire


getAxes() ​

ts
getAxes(chart): object;

Defined in: core/renderers/base.ts:320

Axes this renderer draws against on chart: the one the series' x is plotted on, and the one for its y. By default the first X-component axis and the first Y-component axis of the same coordinate system; a horizontal renderer swaps them.

Parameters ​

chart ​

D3PChart

Returns ​

object

x? ​
ts
x?: D3PAxis;
y? ​
ts
y?: D3PAxis;

Inherited from ​

D3PPathRenderer.getAxes


getCharts() ​

ts
getCharts(): D3PChart[];

Defined in: core/object.ts:105

The charts the object is attached to.

Returns ​

D3PChart[]

Inherited from ​

D3PPathRenderer.getCharts


hasChart() ​

ts
hasChart(chart): boolean;

Defined in: core/object.ts:110

Whether the object is attached to this chart.

Parameters ​

chart ​

D3PChart

Returns ​

boolean

Inherited from ​

D3PPathRenderer.hasChart


legendEntries() ​

ts
legendEntries(): D3PLegendItem[];

Defined in: core/renderers/base.ts:215

The legend lines of this renderer: itself by default.

Returns ​

D3PLegendItem[]

Inherited from ​

D3PPathRenderer.legendEntries


onDestroy() ​

ts
protected onDestroy(): void;

Defined in: core/renderers/base.ts:264

Hook run first on destroy (detach from partners, release DOM...).

Returns ​

void

Inherited from ​

D3PPathRenderer.onDestroy


pathGenerator() ​

ts
protected pathGenerator(
   chart, 
   system, 
   _sy
): (pts) => string | null;

Defined in: core/renderers/line.ts:32

The generator of the line, in any system.

Parameters ​

chart ​

D3PChart

system ​

D3PCoordinateSystem

_sy ​

D3PScale

Returns ​

(pts) => string | null

Overrides ​

D3PPathRenderer.pathGenerator


pathStyle() ​

ts
protected pathStyle(props, hidden): object;

Defined in: core/renderers/line.ts:24

fixed never changes; animated is tweened (and driven to its hidden value when hidden).

Parameters ​

props ​

D3PLineProps

hidden ​

boolean

Returns ​

object

animated ​
ts
animated: object;
animated.stroke-width ​
ts
"stroke-width": number;
fixed ​
ts
fixed: object;
fixed.fill ​
ts
fill: string = 'none';
fixed.stroke ​
ts
stroke: string = props.style.color;

Overrides ​

D3PPathRenderer.pathStyle


probeHit() ​

ts
probeHit(
   chart, 
   event, 
   joins?
): D3PProbeHit | undefined;

Defined in: core/renderers/path.ts:75

What this renderer finds for event on chart: by default the data point whose X is closest to the value under the pointer (read through the probe, so joins apply). Renderers that do not map data through axes (a pie) test the pixel instead. Ask the probe (d3pProbe(chart).hit) rather than this method: it computes once per event.

Parameters ​

chart ​

D3PChart

event ​

D3PPointerEvent

joins? ​

readonly D3PJoinGroup[] = []

Returns ​

D3PProbeHit | undefined

Inherited from ​

D3PPathRenderer.probeHit


projectFrom() ​

ts
projectFrom(point, cache?): 
  | [D3PDomainValue, D3PDomainValue]
  | undefined;

Defined in: core/renderers/base.ts:358

Data values [x, y] under a viewport point; undefined outside of the system.

Parameters ​

point ​

D3PViewportPoint

cache? ​

D3PProjectionCache

Returns ​

| [D3PDomainValue, D3PDomainValue] | undefined

Inherited from ​

D3PPathRenderer.projectFrom


projectTo() ​

ts
projectTo(
   chart, 
   x, 
   y, 
   cache?
): D3PViewportPoint | undefined;

Defined in: core/renderers/base.ts:351

Viewport point of the data point (x, y).

Parameters ​

chart ​

D3PChart

x ​

D3PDomainValue

y ​

D3PDomainValue

cache? ​

D3PProjectionCache

Returns ​

D3PViewportPoint | undefined

Inherited from ​

D3PPathRenderer.projectTo


projectToRange() ​

ts
projectToRange(
   chart, 
   x, 
   y, 
   cache?
): [number, number] | undefined;

Defined in: core/renderers/base.ts:341

Position of the data point (x, y) in range units, in the order of the dimensions of the system (the series' x goes on the first dimension unless the renderer is horizontal).

Parameters ​

chart ​

D3PChart

x ​

D3PDomainValue

y ​

D3PDomainValue

cache? ​

D3PProjectionCache

Returns ​

[number, number] | undefined

Inherited from ​

D3PPathRenderer.projectToRange


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 ​

D3PChart

Returns ​

void

Inherited from ​

D3PPathRenderer.removeFromChart


render() ​

ts
render(chart): Promise<void>;

Defined in: core/renderers/base.ts:387

Draws the object on a chart. The render manager calls it, once per frame, for the objects that asked for it.

Parameters ​

chart ​

D3PChart

Returns ​

Promise<void>

Inherited from ​

D3PPathRenderer.render


renderData() ​

ts
protected renderData(
   chart, 
   data, 
   x?, 
   y?
): void;

Defined in: core/renderers/path.ts:131

Draws the series at once, with no transition.

Parameters ​

chart ​

D3PChart

data ​

D3PPathData

x? ​

D3PAxis

y? ​

D3PAxis

Returns ​

void

Inherited from ​

D3PPathRenderer.renderData


renderDataHidden() ​

ts
protected renderDataHidden(
   chart, 
   data, 
   x?, 
   y?
): void;

Defined in: core/renderers/path.ts:170

Draws the series going away: the renderer was hidden.

Parameters ​

chart ​

D3PChart

data ​

D3PPathData

x? ​

D3PAxis

y? ​

D3PAxis

Returns ​

void

Inherited from ​

D3PPathRenderer.renderDataHidden


renderDataWithTransition() ​

ts
protected renderDataWithTransition(
   chart, 
   data, 
   x?, 
   y?
): void;

Defined in: core/renderers/path.ts:143

Draws the series moving from what is on screen to what the data and the scales say now.

Parameters ​

chart ​

D3PChart

data ​

D3PPathData

x? ​

D3PAxis

y? ​

D3PAxis

Returns ​

void

Inherited from ​

D3PPathRenderer.renderDataWithTransition


scalesOf() ​

ts
protected scalesOf(
   chart, 
   x?, 
   y?
): 
  | {
  sx: D3PScale;
  sy: D3PScale;
  system: D3PCoordinateSystem;
}
  | undefined;

Defined in: core/renderers/base.ts:430

Scales and coordinate system to draw with; throws if the system is not one the renderer supports.

Parameters ​

chart ​

D3PChart

x? ​

D3PAxis

y? ​

D3PAxis

Returns ​

| { sx: D3PScale; sy: D3PScale; system: D3PCoordinateSystem; } | undefined

Inherited from ​

D3PPathRenderer.scalesOf


seriesChanged() ​

ts
protected seriesChanged(): void;

Defined in: core/renderers/base.ts:207

The series, or its data, changed. Renderers whose legend depends on the data announce it here.

Returns ​

void

Inherited from ​

D3PPathRenderer.seriesChanged


tagDirty() ​

ts
tagDirty(chart?): void;

Defined in: core/renderers/base.ts:276

Schedule a redraw on one chart (or all attached charts).

Parameters ​

chart? ​

D3PChart

Returns ​

void

Inherited from ​

D3PPathRenderer.tagDirty


tagDirtyWithTransition() ​

ts
tagDirtyWithTransition(chart?): void;

Defined in: core/renderers/base.ts:272

Asks to draw again, with a transition: on one chart, or on all of them.

Parameters ​

chart? ​

D3PChart

Returns ​

void

Inherited from ​

D3PPathRenderer.tagDirtyWithTransition

Properties ​

axes ​

ts
readonly axes: D3PAxisFilter | undefined;

Defined in: core/renderers/base.ts:109

The axes the renderer is restricted to (objects or names), if any.

Inherited from ​

D3PPathRenderer.axes


bus ​

ts
readonly bus: D3PBus;

Defined in: core/object.ts:27

The bus the object uses for its events.

Inherited from ​

D3PPathRenderer.bus


chartData ​

ts
protected readonly chartData: Map<D3PChart, D3PRendererChartData<D3PPathData>>;

Defined in: core/object.ts:66

What the object keeps for each chart it is attached to.

Inherited from ​

D3PPathRenderer.chartData


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 ​

D3PPathRenderer.e


id ​

ts
readonly id: number = ++D3PSeriesRenderer.counter;

Defined in: core/renderers/base.ts:105

A number that identifies the renderer: 1 for the first one created.

Inherited from ​

D3PPathRenderer.id


isDestroying ​

ts
isDestroying: boolean = false;

Defined in: core/object.ts:31

Set when destroy starts: the object is not drawn after that.

Inherited from ​

D3PPathRenderer.isDestroying


name ​

ts
readonly name: string;

Defined in: core/renderers/base.ts:107

The name of the renderer: the series name unless given.

Inherited from ​

D3PPathRenderer.name


pathClass ​

ts
protected readonly pathClass: "line" = 'line';

Defined in: core/renderers/line.ts:18

The CSS class of the path.

Overrides ​

D3PPathRenderer.pathClass


propsHandle ​

ts
protected readonly propsHandle: D3PPropsHandle<D3PLineProps & object>;

Defined in: core/renderers/base.ts:117

The props and their change hooks.

Inherited from ​

D3PPathRenderer.propsHandle


requiredColumns ​

ts
protected readonly requiredColumns: readonly string[] = [];

Defined in: core/renderers/base.ts:115

Columns the series must have (['open', 'high', 'low', 'close']); checked when attaching.

Inherited from ​

D3PPathRenderer.requiredColumns


subs ​

ts
protected readonly subs: D3PSubscriptions;

Defined in: core/object.ts:33

The subscriptions of the object, released when it is destroyed.

Inherited from ​

D3PPathRenderer.subs


system ​

ts
readonly system: string | undefined;

Defined in: core/renderers/base.ts:111

The name of the coordinate system the renderer draws in, if it was given one.

Inherited from ​

D3PPathRenderer.system


systemKinds ​

ts
protected readonly systemKinds: readonly string[] | undefined = undefined;

Defined in: core/renderers/base.ts:113

Kinds of coordinate system the renderer can draw in (undefined: any).

Inherited from ​

D3PPathRenderer.systemKinds