# lv_line.h (/api/widgets/line/lv_line_h)



<RelatedHeaders name="lv_line_private.h" isPrivate="false" />

<ApiSummary functions="9" enums="1" variables="1" />

Functions [#functions]

<ApiTabs items="[&#x22;Setters (3)&#x22;,&#x22;Getters (4)&#x22;,&#x22;Other (2)&#x22;]">
  <ApiTab value="Setters (3)">
    <ApiMember kind="function" name="lv_line_set_points" file="widgets/line/lv_line.h" line="57" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/line/lv_line.h#L57">
      lv_line_set_points [#lv_line_set_points]

      Set an array of points. The line object will connect these points.

      ```c title=" " lineNumbers=1
      void lv_line_set_points(lv_obj_t *obj, const lv_point_precise_t points[], uint32_t point_num)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name        | Type                                                                     | Description                                                                                         |
      | ----------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------- |
      | `obj`       | <ApiLink name="lv_obj_t" display="lv_obj_t *" />                         | pointer to a line object                                                                            |
      | `points`    | <ApiLink name="lv_point_precise_t" display="const lv_point_precise_t" /> | an array of points. Only the address is saved, so the array needs to be alive while the line exists |
      | `point_num` | <ApiLink name="uint32_t" />                                              | number of points in 'point\_a'                                                                      |
    </ApiMember>

    <ApiMember kind="function" name="lv_line_set_points_mutable" file="widgets/line/lv_line.h" line="65" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/line/lv_line.h#L65">
      lv_line_set_points_mutable [#lv_line_set_points_mutable]

      Set a non-const array of points. Identical to `lv_line_set_points` except the array may be retrieved by `lv_line_get_points_mutable`.

      ```c title=" " lineNumbers=1
      void lv_line_set_points_mutable(lv_obj_t *obj, lv_point_precise_t points[], uint32_t point_num)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name        | Type                                             | Description                                                                                                   |
      | ----------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- |
      | `obj`       | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a line object                                                                                      |
      | `points`    | <ApiLink name="lv_point_precise_t" />            | a non-const array of points. Only the address is saved, so the array needs to be alive while the line exists. |
      | `point_num` | <ApiLink name="uint32_t" />                      | number of points in 'point\_a'                                                                                |
    </ApiMember>

    <ApiMember kind="function" name="lv_line_set_y_invert" file="widgets/line/lv_line.h" line="74" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/line/lv_line.h#L74">
      lv_line_set_y_invert [#lv_line_set_y_invert]

      Enable (or disable) the y coordinate inversion. If enabled then y will be subtracted from the height of the object, therefore the y = 0 coordinate will be on the bottom.

      ```c title=" " lineNumbers=1
      void lv_line_set_y_invert(lv_obj_t *obj, bool en)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                                                 |
      | ----- | ------------------------------------------------ | ----------------------------------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a line object                                    |
      | `en`  | <ApiLink name="bool" />                          | true: enable the y inversion, false:disable the y inversion |
    </ApiMember>
  </ApiTab>

  <ApiTab value="Getters (4)">
    <ApiMember kind="function" name="lv_line_get_points" file="widgets/line/lv_line.h" line="85" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/line/lv_line.h#L85">
      lv_line_get_points [#lv_line_get_points]

      Get the pointer to the array of points.

      ```c title=" " lineNumbers=1
      const lv_point_precise_t * lv_line_get_points(lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description              |
      | ----- | ------------------------------------------------ | ------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a line object |

      **Returns:** <ApiLink name="lv_point_precise_t" display="const lv_point_precise_t *" /> — const pointer to the array of points
    </ApiMember>

    <ApiMember kind="function" name="lv_line_get_point_count" file="widgets/line/lv_line.h" line="92" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/line/lv_line.h#L92">
      lv_line_get_point_count [#lv_line_get_point_count]

      Get the number of points in the array of points.

      ```c title=" " lineNumbers=1
      uint32_t lv_line_get_point_count(lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description              |
      | ----- | ------------------------------------------------ | ------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a line object |

      **Returns:** <ApiLink name="uint32_t" /> — number of points in array of points
    </ApiMember>

    <ApiMember kind="function" name="lv_line_get_points_mutable" file="widgets/line/lv_line.h" line="106" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/line/lv_line.h#L106">
      lv_line_get_points_mutable [#lv_line_get_points_mutable]

      Get a pointer to the mutable array of points or NULL if it is not mutable

      ```c title=" " lineNumbers=1
      lv_point_precise_t * lv_line_get_points_mutable(lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description              |
      | ----- | ------------------------------------------------ | ------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a line object |

      **Returns:** <ApiLink name="lv_point_precise_t" display="lv_point_precise_t *" /> — pointer to the array of points. NULL if not mutable.
    </ApiMember>

    <ApiMember kind="function" name="lv_line_get_y_invert" file="widgets/line/lv_line.h" line="113" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/line/lv_line.h#L113">
      lv_line_get_y_invert [#lv_line_get_y_invert]

      Get the y inversion attribute

      ```c title=" " lineNumbers=1
      bool lv_line_get_y_invert(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description              |
      | ----- | ------------------------------------------------------ | ------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to a line object |

      **Returns:** <ApiLink name="bool" /> — true: y inversion is enabled, false: disabled
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (2)">
    <ApiMember kind="function" name="lv_line_create" file="widgets/line/lv_line.h" line="45" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/line/lv_line.h#L45">
      lv_line_create [#lv_line_create]

      Create a line object

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_line_create(lv_obj_t *parent)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name     | Type                                             | Description                                                 |
      | -------- | ------------------------------------------------ | ----------------------------------------------------------- |
      | `parent` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to an object, it will be the parent of the new line |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — pointer to the created line
    </ApiMember>

    <ApiMember kind="function" name="lv_line_is_point_array_mutable" file="widgets/line/lv_line.h" line="99" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/line/lv_line.h#L99">
      lv_line_is_point_array_mutable [#lv_line_is_point_array_mutable]

      Check the mutability of the stored point array pointer.

      ```c title=" " lineNumbers=1
      bool lv_line_is_point_array_mutable(lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description              |
      | ----- | ------------------------------------------------ | ------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a line object |

      **Returns:** <ApiLink name="bool" /> — true: the point array pointer is mutable, false: constant
    </ApiMember>
  </ApiTab>
</ApiTabs>

Enums [#enums]

<ApiMember kind="enum" name="_lv_property_line_id_t" file="widgets/line/lv_line.h" line="30" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/line/lv_line.h#L30">
  \_lv_property_line_id_t [#_lv_property_line_id_t]

  | Name                        | Value                                                          |
  | --------------------------- | -------------------------------------------------------------- |
  | `LV_PROPERTY_LINE_Y_INVERT` | `(LV_PROPERTY_LINE_START + ((int) 0 )) \| ((  11   ) <<  28 )` |
  | `LV_PROPERTY_LINE_END`      |                                                                |
</ApiMember>

Variables [#variables]

<ApiMember kind="variable" name="lv_line_class" file="widgets/line/lv_line.h" line="27" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/line/lv_line.h#L27">
  lv_line_class [#lv_line_class]

  ```c title=" " lineNumbers=1
  const lv_obj_class_t lv_line_class
  ```
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_obj.h&#x22;]" includedBy="[&#x22;lv_line_private.h&#x22;, &#x22;lv_scale.h&#x22;]" transitiveIncludes="[&#x22;lv_anim.h&#x22;, &#x22;lv_area.h&#x22;, &#x22;lv_array.h&#x22;, &#x22;lv_assert.h&#x22;, &#x22;lv_bidi.h&#x22;, &#x22;lv_color.h&#x22;, &#x22;lv_color_op.h&#x22;, &#x22;lv_conf_internal.h&#x22;, &#x22;lv_conf_kconfig.h&#x22;, &#x22;lv_display.h&#x22;, &#x22;lv_draw.h&#x22;, &#x22;lv_draw_arc.h&#x22;, &#x22;lv_draw_blur.h&#x22;, &#x22;lv_draw_buf.h&#x22;, &#x22;lv_draw_image.h&#x22;, &#x22;lv_draw_label.h&#x22;, &#x22;lv_draw_line.h&#x22;, &#x22;lv_draw_rect.h&#x22;, &#x22;lv_draw_triangle.h&#x22;, &#x22;lv_event.h&#x22;, &#x22;lv_ext_data.h&#x22;, &#x22;lv_flex.h&#x22;, &#x22;lv_font.h&#x22;, &#x22;lv_fs.h&#x22;, &#x22;lv_grad.h&#x22;, &#x22;lv_grid.h&#x22;, &#x22;lv_group.h&#x22;, &#x22;lv_image_decoder.h&#x22;, &#x22;lv_image_dsc.h&#x22;, &#x22;lv_indev.h&#x22;, &#x22;lv_layout.h&#x22;, &#x22;lv_ll.h&#x22;, &#x22;lv_log.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_matrix.h&#x22;, &#x22;lv_mem.h&#x22;, &#x22;lv_obj_class.h&#x22;, &#x22;lv_obj_draw.h&#x22;, &#x22;lv_obj_event.h&#x22;, &#x22;lv_obj_pos.h&#x22;, &#x22;lv_obj_property.h&#x22;, &#x22;lv_obj_property_names.h&#x22;, &#x22;lv_obj_scroll.h&#x22;, &#x22;lv_obj_style.h&#x22;, &#x22;lv_obj_style_gen.h&#x22;, &#x22;lv_obj_tree.h&#x22;, &#x22;lv_palette.h&#x22;, &#x22;lv_profiler.h&#x22;, &#x22;lv_profiler_builtin.h&#x22;, &#x22;lv_sprintf.h&#x22;, &#x22;lv_string.h&#x22;, &#x22;lv_style.h&#x22;, &#x22;lv_style_gen.h&#x22;, &#x22;lv_style_properties.h&#x22;, &#x22;lv_symbol_def.h&#x22;, &#x22;lv_text.h&#x22;, &#x22;lv_tick.h&#x22;, &#x22;lv_timer.h&#x22;, &#x22;lv_types.h&#x22;]" />
