Skip to content
ChartDeck ChartScript docs Account Open the terminal

polyline

Lines through many points.

#Functions

#polyline.deletefunction

Removes the polyline.

polyline.delete(id: polyline)
ParameterTypeDescription
idpolylineThe array.

Example

ChartScriptFragmentOpen in editor
const pts = array.from(chart.point.now(low), chart.point.now(high))
const pl = polyline.new(pts)
pl.delete()

Since ChartScript 1

#polyline.newfunction

A line through up to 10,000 chart.points (curved, closed and filled if asked). The oldest is removed past max_polylines_count.

polyline.new(points: array<point>, { curved?: bool = false, closed?: bool = false, xloc?: simple string = xloc.bar_index, line_color?: color = color.blue, fill_color?: color = na, line_style?: string = line.style_solid, line_width?: int = 1, force_overlay?: const bool = false, look?: const string = "" }): polyline
ParameterTypeDescription
pointsarray<point>The points.
curvedbooldefault falseThe curved.
closedbooldefault falseThe closed.
xlocsimple stringdefault xloc.bar_indexThe xloc.
line_colorcolordefault color.blueThe line color.
fill_colorcolordefault naThe fill color.
line_stylestringdefault line.style_solidThe line style.
line_widthintdefault 1The line width.
force_overlayconst booldefault falseAccepted and ignored in this version.
lookconst stringdefault ""The look.

Returns polyline.

Example

ChartScriptFragmentOpen in editor
const pts = array.from(chart.point.from_index(bar_index - 2, low), chart.point.now(high))
const pl = polyline.new(pts)

Since ChartScript 1

#Variables

#polyline.allvariable

Every polyline of the script that still exists.

polyline.all: array<polyline>

Type series array<polyline>.

Example

ChartScriptFragmentOpen in editor
const n = array.size(polyline.all)

Since ChartScript 1

The ChartScript documentation is in English for now; translations will follow.