1# Line (lv_line)
2
3## Overview
4The Line object is capable of drawing straight lines between a set of points.
5
6## Parts and Styles
7- `LV_PART_MAIN` uses all the typical background properties and line style properties.
8
9## Usage
10
11### Set points
12The points have to be stored in an `lv_point_t` array and passed to the object by the `lv_line_set_points(lines, point_array, point_cnt)` function.
13
14### Auto-size
15By default, the Line's width and height are set to `LV_SIZE_CONTENT`. This means it will automatically set its size to fit all the points. If the size is set explicitly, parts on the line may not be visible.
16
17### Invert y
18By default, the *y == 0* point is in the top of the object. It might be counter-intuitive in some cases so the y coordinates can be inverted with `lv_line_set_y_invert(line, true)`. In this case,  *y == 0* will be the bottom of the object.
19*y invert* is disabled by default.
20
21## Events
22Only the [Generic events](../overview/event.html#generic-events) are sent by the object type.
23
24See the events of the [Base object](/widgets/obj) too.
25
26Learn more about [Events](/overview/event).
27
28## Keys
29No *Keys* are processed by the object type.
30
31Learn more about [Keys](/overview/indev).
32
33## Example
34
35```eval_rst
36
37.. include:: ../../../examples/widgets/line/index.rst
38
39```
40
41## API
42
43```eval_rst
44
45.. doxygenfile:: lv_line.h
46  :project: lvgl
47
48```
49