Hi Ayush,
We have checked your code snippet and found that you have set the visibleMaximum of Duration(minutes: 3000) which means adding 50 hours from the 400th data point, in this case, if you have data source in the hour's difference it will show a 50 data points in the visible range. So, we have modified the code snippet and shared it below for your reference.
Code snippet:
primaryXAxis: DateTimeCategoryAxis( visibleMinimum: data[400].x, visibleMaximum: data[400].x.add(const Duration(minutes: 1800)), ), |
If you want to show the last or first 30 points from the overall data points, you can use the autoScrollingDelta and autoScrollingMode properties in the axis. Here autoScrollingDelta is a number of data points that need to be visible in the viewport and autoScrollingMode represent where the data point starts to show like the start or end of the list. We have shared the code snippet and UG documentation below for your reference.
Code snippet:
primaryXAxis: DateTimeCategoryAxis( autoScrollingDelta: 30, autoScrollingMode: AutoScrollingMode.end, ), |
UG, https://help.syncfusion.com/flutter/cartesian-charts/axis-customization#auto-scrolling
Regards,
Yuvaraj.