Skip to content

charton API


charton API / @chart-on/core / index / LineSeriesOptions

Interface: LineSeriesOptions ​

Defined in: packages/core/src/series.ts:2603

Options for a line series (chart.addLine): colour, width and line style, an optional area fill, an optional mapping from the main series, markers, labels and price scale placement.

Extends ​

Properties ​

aboveColor? ​

optional aboveColor?: string

Defined in: packages/core/src/series.ts:2629


area ​

area: boolean

Defined in: packages/core/src/series.ts:2617

Fill under the line with a vertical gradient.


autoscale? ​

optional autoscale?: boolean | AutoscaleProvider

Defined in: packages/core/src/series.ts:272

How the series takes part in its price scale's autoscale. true (the default) fits its visible values, false leaves it out (it still draws, possibly off the pane), and a function adjusts the range it adds. Primitives attached to the series still add their own ranges.

Inherited from ​

PriceLineSeriesOptions.autoscale


axisTitle? ​

optional axisTitle?: boolean

Defined in: packages/core/src/series.ts:2672

Show the series title (e.g. the symbol) in a tag beside the last-value label.


baseline? ​

optional baseline?: number

Defined in: packages/core/src/series.ts:2628

Baseline mode: line and fill switch between aboveColor and belowColor at this value (e.g. 0 for cumulative delta).


belowColor? ​

optional belowColor?: string

Defined in: packages/core/src/series.ts:2630


breakGaps? ​

optional breakGaps?: boolean

Defined in: packages/core/src/series.ts:2632

Break the line over timeline bars where the series has no point, instead of joining across them.


color? ​

optional color?: string

Defined in: packages/core/src/series.ts:2614


colorMode? ​

optional colorMode?: "segment" | "gradient"

Defined in: packages/core/src/series.ts:2623

How points' own colors join (default 'segment'): each segment in the colour of the point it starts at, or 'gradient', blended from one point's colour to the next one's.


crosshairMarker? ​

optional crosshairMarker?: boolean | { color?: string; radius?: number; }

Defined in: packages/core/src/series.ts:2659

A dot where the crosshair meets the line (default off). radius in css px; color defaults to the line colour at that point.


follow? ​

optional follow?: FollowMapper<ValuePoint>

Defined in: packages/core/src/series.ts:2613

Derive the series from the main series: called with each main bar, the one before it and the theme; return a point, or null for none. The chart keeps it in step on loads, history pages, symbol switches, live bars and theme changes. See volumeOf.


format ​

format: (value) => string

Defined in: packages/core/src/series.ts:2667

Parameters ​

value ​

number

Returns ​

string


lastPointPulse? ​

optional lastPointPulse?: LastPointPulse

Defined in: packages/core/src/series.ts:2666

A pulse on the last point (default 'off'): 'on-update' rings once per live update, 'continuous' keeps ringing while the point is on screen. Reduced motion shows a still dot instead. See LastPointPulseOptions. Needs the lastPointPulse() plugin; without it the option draws nothing.


lastValueLabel ​

lastValueLabel: boolean

Defined in: packages/core/src/series.ts:2670


legend? ​

optional legend?: boolean

Defined in: packages/core/src/series.ts:2606

false leaves this series out of the legend. Default true.


lineStyle? ​

optional lineStyle?: LineStyle

Defined in: packages/core/src/series.ts:2634

Solid, dashed or dotted stroke (default 'solid').


lineType? ​

optional lineType?: LineType

Defined in: packages/core/src/series.ts:2649

How points are joined (default 'simple'): straight segments, 'step' (level until the next point, then a vertical jump) or 'curved' (a smooth curve through every point that never overshoots it).


lineWidth ​

lineWidth: number

Defined in: packages/core/src/series.ts:2615


offscreenLastPrice? ​

optional offscreenLastPrice?: "hidden" | "hollow"

Defined in: packages/core/src/series.ts:283

The last-value label when the newest bar is panned off screen: 'hollow' draws it as an outline, 'hidden' leaves it out. Unset keeps it as is.

Inherited from ​

PriceLineSeriesOptions.offscreenLastPrice


overlay? ​

optional overlay?: OverlayMargins

Defined in: packages/core/src/series.ts:2673


pointMarkers? ​

optional pointMarkers?: boolean | { radius?: number; }

Defined in: packages/core/src/series.ts:2654

A dot on every point (default off). Drawn only while bars are wide enough for the dots not to merge. radius in css px.


priceFormat? ​

optional priceFormat?: PriceFormat

Defined in: packages/core/src/series.ts:2669

Overrides format for labels, and gives the pane its tick size and axis unit.


priceLine? ​

optional priceLine?: boolean | SeriesPriceLineOptions

Defined in: packages/core/src/series.ts:278

Price line across the plot: true for the default style, an object to style it, false for none. Separate from lastValueLabel. Default: on for the main candle series, off for the others.

Inherited from ​

PriceLineSeriesOptions.priceLine


priceScale? ​

optional priceScale?: string

Defined in: packages/core/src/series.ts:2678

Price scale id in the pane (default 'right'). 'left' shows a left axis; other ids are overlays until given a side. Ignored with overlay.


renderer? ​

optional renderer?: "canvas" | "gpu"

Defined in: packages/core/src/series.ts:2643

Where the line is stroked (default 'gpu'). 'gpu' strokes it with WebGL2, which costs the CPU far less on long lines, many lines or frequent redraws. GPU lines (and their area fill) draw below every series drawn on the canvas, like candles do; 'canvas' strokes them with the 2D canvas, so zIndex orders them among other canvas series. Curved lines and lines with per-point colours always draw on the canvas.


title ​

title: string

Defined in: packages/core/src/series.ts:2604