feat(chart) add rename lv_chart_set_cursor_point to lv_chart_set_cursor_pos and add lv_chart_set_cursor_point to stick the cursor to a point
This commit is contained in:
@@ -109,12 +109,15 @@ If `factor` is 256 there is no zoom. 512 means double zoom, etc. Fractional valu
|
||||
A cursor can be added with `lv_chart_cursor_t * c1 = lv_chart_add_cursor(chart, color, dir);`.
|
||||
The possible values of `dir` `LV_DIR_NONE/RIGHT/UP/LEFT/DOWN/HOR/VER/ALL` or their OR-ed values to tell in which direction(s) should the cursor be drawn.
|
||||
|
||||
`lv_chart_set_cursor_point(chart, cursor, &point)` sets the position of the cursor.
|
||||
`point` is a pointer to an `lv_poin_t` variable. E.g. `lv_point_t point = {10, 20};`.
|
||||
`lv_chart_set_cursor_pos(chart, cursor, &point)` sets the position of the cursor.
|
||||
`pos` is a pointer to an `lv_point_t` variable. E.g. `lv_point_t point = {10, 20};`. If the chart is scrolled the cursor will remain on the same place.
|
||||
|
||||
`lv_chart_get_point_pos_by_id(chart, series, id, &point_out)` tells the coordinate of a given point. It's useful to place the cursor to given point.
|
||||
|
||||
`lv_chart_set_cursor_point(chart, cursor, series, point_id)` sticks the cursor the point. If the point's position changes (new value or scrolling) the cursor will move with the point.
|
||||
|
||||
## Events
|
||||
- `LV_EVENT_VALUE_CHANGED` Sent when a new point is clicked perssed. `lv_chart_get_pressed_point(chart)` returns the zero based index of the pressed point.
|
||||
- `LV_EVENT_DRAW_PART_BEGIN` and `LV_EVENT_DRAW_PART_END` are sent for multiple parts. The fields of `lv_obj_draw_part_dsc_t` is set as the followings:
|
||||
- `LV_PART_ITEMS` (the series)
|
||||
- *Line chart* `clip_area`, `id` (index of the point), `value` (value of `id`th point), `p1`, `p2` (points of the line), `draw_area` (area of the point), `line_dsc`, `rect_dsc`, `sub_part_ptr` (pointer to the series), `part`
|
||||
|
||||
Reference in New Issue
Block a user