1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00
lvgl/docs/widgets/core/line.md
Gabor Kiss-Vamosi 88c485949f feat(event, widgets) improve the paramter of LV_EVENT_DRAW_PART_BEGIN/END
Add lv_<widget>_draw_part_type_t to widgets to precisly describe the hooked drawings.
Also add class_p element to lv_obj_draw_part_dsc_t to show what widgets lv_<widget>_draw_part_type_t needs to be used.

Related to: https://forum.lvgl.io/t/how-to-add-minor-division-lines-to-a-chart/5366/
2021-07-07 16:19:06 +02:00

1.4 KiB

.. include:: /header.rst 
:github_url: |github_link_base|/widgets/line.md

Line (lv_line)

Overview

The Line object is capable of drawing straight lines between a set of points.

Parts and Styles

  • LV_PART_MAIN uses all the typical background properties and line style properties.

Usage

Set points

The 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.

Auto-size

By 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.

Invert y

By default, the y == 0 point is in the top of the object. It might be conter-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. y invert is disabled by default.

Events

Only the Generic events are sent by the object type.

See the events of the Base object too.

Learn more about Events.

Keys

No Keys are processed by the object type.

Learn more about Keys.

Example


.. include:: ../../../examples/widgets/line/index.rst

API


.. doxygenfile:: lv_line.h
  :project: lvgl