Draw gradient below chart line in lvgl 9.x

While changing from lvgl 8.x to 9.x, I run into to something for which I can’t find an answer, perhaps some smarter people here have some pointers for me.

Using 8, I attach a draw event callback (using LV_EVENT_DRAW_PART_BEGIN) and called a function (see code below) to get a nice gradient below the line being drawn in the chart.

Now I saw the example, to add a gradient to the complete chart (also nice, but not my intention), can something like the example be adjusted to use it for drawing below the chart-series?

My code for lvgl 8:

static void DrawGradient(lv_event_t *e)
    lv_obj_t *obj = (lv_obj_t*)lv_event_get_target(e);
    lv_draw_task_t *draw_task = (lv_draw_task_t*)lv_event_get_draw_task(e);
    lv_draw_dsc_base_t *dsc = (lv_draw_dsc_base_t*)draw_task->draw_dsc;

    if (dsc->part == LV_PART_ITEMS)
        lv_draw_mask_line_param_t line_mask_param;
        lv_draw_mask_line_points_init(&line_mask_param, dsc->p1->x, dsc->p1->y, dsc->p2->x, dsc->p2->y, LV_DRAW_MASK_LINE_SIDE_BOTTOM);
        int16_t line_mask_id = lv_draw_mask_add(&line_mask_param, NULL);

        lv_coord_t h = lv_obj_get_height(obj);
        lv_draw_mask_fade_param_t fade_mask_param;
        lv_draw_mask_fade_init(&fade_mask_param, &obj->coords, LV_OPA_COVER, obj->coords.y1 + h / 8, LV_OPA_40, obj->coords.y2);
        int16_t fade_mask_id = lv_draw_mask_add(&fade_mask_param, NULL);

        lv_draw_rect_dsc_t draw_rect_dsc;
        draw_rect_dsc.bg_opa = LV_OPA_40;
        draw_rect_dsc.bg_color = dsc->line_dsc->color;

        lv_area_t a;
        a.x1 = dsc->p1->x;
        a.x2 = dsc->p2->x - 1;
        a.y1 = LV_MIN(dsc->p1->y, dsc->p2->y);
        a.y2 = obj->coords.y2;
        lv_draw_rect(dsc->draw_ctx, &draw_rect_dsc, &a);


Solved the issue, used this example as basis.