flutter-charts icon indicating copy to clipboard operation
flutter-charts copied to clipboard

Is it possible to know when the user scrolled to the end?

Open MeloHenrique opened this issue 4 years ago • 2 comments

Hello,

I wanted to add pagination to my charts. Initially, the chart will receive recent data. But if the user scrolls to the end, it will run a function and ask for more data.

Is it possible to do?

MeloHenrique avatar Jul 16 '21 15:07 MeloHenrique

Hi @MeloHenrique,

This is possible, but you will have to write pagination logic.

Example for scrollable chart can be found in here

Setting isScrollable in ChartBehaviour to true will make sure that chart ignores width of the parent. You have to wrap chart in scrollable widget, and from there you can attach scroll controller to the scrollable widget and manipulate data in the chart (to load more) when controller is near ar at the end.

p.s. when setting isScrollable to true you should define, min/max item width in ItemOptions, since that is the value items will use in that case.

lukaknezic avatar Jul 20 '21 12:07 lukaknezic

Yeah, and I have tried the same, with scrolnotification property , metrices.extendbefore property can add condition for right scrolling & left scrolling, and can Identify give loadmore method can call by extendbefore conditioning.

irshadshan000 avatar Apr 05 '22 10:04 irshadshan000