How to use Chart widget, ie for temperature data

An addition to the topic: Even if the series/dataset is not accessible outside the screen-init function, the chart itself is. Unfortunately to do anything with the prepared series/data you need to have the series in the lv_chart_set_ext_y_array(chart,series,array) and similar functions.
Fortunately lv_chart_get_series_next comes to the rescue: if NULL is given as 2nd argument it returns the first series, so an lv_chart_get_series( chart, NULL ) returns a hook to the series to the one made in SquareLine Studio, which you can use afterwards to delete/modify it and its data.
(The other topic contains the same answer albeit shorter: Declare variable ui_chart_x_series_x globally - #2 by kisvegabor )