Files
lightweight-charts-python/docs/source/reference/line.md
louisnw a7c1dc8a30 Enhancements:
- Added the `screen` parameter to `Chart`, allowing for monitor selection. This should be an index from 0 (0 = primary monitor, 1=  second monitor, etc.)
- `vertical_span` method, allowing for vertical lines/spans to be drawn across the chart.
- `set_visible_range` method, which will set the visible range of the chart based on two given dates.
- `resize` method, which resizes the chart to the given size.
- `sync` will now sync both charts, regardless of which one is scrolled/zoomed.
2023-08-31 21:25:00 +01:00

1.1 KiB

Line


The `Line` object represents a `LineSeries` object in Lightweight Charts and can be used to create indicators. As well as the methods described below, the `Line` object also has access to:

[`marker`](#marker), [`horizontal_line`](#AbstractChart.horizontal_line) [`hide_data`](#hide_data), [`show_data`](#show_data) and [`price_line`](#price_line).

Its instance should only be accessed from [create_line](#AbstractChart.create_line).
___



```{py:method} set(data: pd.DataFrame) 

Sets the data for the line.

When a name has not been set upon declaration, the columns should be named: `time | value` (Not case sensitive).

Otherwise, the method will use the column named after the string given in `name`. This name will also be used within the legend of the chart.

```
___



```{py:method} update(series: pd.Series)

Updates the data for the line.

This should be given as a Series object, with labels akin to the `line.set()` function.
```



___

```{py:method} line.delete()

Irreversibly deletes the line.

```