Polyline
Handle for a polyline drawing.
Static Methods
new
navi
Polyline.new(
points: series Array<chart.Point>,
curved: series bool = false,
closed: series bool = false,
xloc: series string = xloc.bar_index,
line_color: series color = color.BLUE,
fill_color: series color = na,
line_style: series string = line.style_solid,
line_width: series int = 1,
force_overlay: series bool = false
): series PolylineCreates a new polyline instance and displays it on the chart, sequentially connecting all of the points in the points array with line segments.
The segments in the drawing can be straight or curved depending on the curved parameter.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
points | series Array<chart.Point> | An array of chart.Point values defining the vertices of the polyline in the order they will be connected. | |
curved | series bool | false | If true, the segments between consecutive points are drawn as smooth curves. If false, straight line segments are used. Optional. The default is false. |
closed | series bool | false | If true, an additional segment is drawn from the last point back to the first, closing the shape. Optional. The default is false. |
xloc | series string | xloc.bar_index | Determines how the x-coordinate of each chart.Point is interpreted. Use xloc.bar_index to treat x as a bar index, or xloc.bar_time to treat x as a UNIX timestamp. Optional. The default is xloc.bar_index. |
line_color | series color | color.BLUE | The color of the line segments. Optional. The default is color.BLUE. |
fill_color | series color | na | The color used to fill the interior of the polyline when it is closed. na means no fill. Optional. The default is na. |
line_style | series string | line.style_solid | The style of the line. Possible values: line.style_solid, line.style_dotted, line.style_dashed, line.style_arrow_left, line.style_arrow_right, line.style_arrow_both. Optional. The default is line.style_solid. |
line_width | series int | 1 | The width of the line in pixels. Optional. The default is 1. |
force_overlay | series bool | false | If true, the polyline is drawn on the main chart pane regardless of which pane the script occupies. If false, it follows the script's pane. Optional. The default is false. |
Returns: series Polyline
Static Properties
all
Returns an array filled with all the current polylines drawn by the script.
Methods
delete
navi
Polyline.delete(id: series Polyline)Deletes the specified polyline from the chart.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
id | series Polyline |