infinum / flutter-charts

Customizable charts library for flutter.
https://pub.dev/packages/charts_painter
MIT License
144 stars 42 forks source link

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

Open MeloHenrique opened 3 years ago

MeloHenrique commented 3 years ago

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?

lukaknezic commented 3 years ago

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.

irshadshan000 commented 2 years ago

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.