Articles in this section
Category / Section

How to Render Particular Part of Data in Flutter CartesianChart?

2 mins read

The Flutter CartesianChart widget provides support to view a specific subset of data from a larger collection. This can be achieved using the initialVisibleMinimum and initialVisibleMaximum properties of an axis.

For example, if you have 10 data points but only need to display data points 4 through 7, you can specify initialVisibleMinimum as 4 and initialVisibleMaximum  as 7 on an axis. This will ensure only the specified range of data is visible.

The following steps explain how to achieve this in the SfCartesianChart.

Step 1: Initialize the Cartesian chart widget with the required parameters and set the initialVisibleMinimum and initialVisibleMaximum properties in the x-axis.

SfCartesianChart(
 // Assigning visible minimum and maximum to the x-axis.
  primaryXAxis: NumericAxis(
    initialVisibleMinimum: 4, 
initialVisibleMaximum: 7, 
interval: 1   ), )

 

Step 2: To view the remaining data, you can enable the panning in the zoomPanBehavior and pan the chart.

late ZoomPanBehavior zoomPanBehavior;
 
// Enable the panning
@override
 void initState() {
  zoomPanBehavior = ZoomPanBehavior(enablePanning: true);
  super.initState();
}
 
// Assigning zoom pan behavior to the chart
  SfCartesianChart(
    zoomPanBehavior: zoomPanBehavior,
  )

 

Sales analyse

  

View the Github Sample here.



Conclusion

I hope you enjoyed learning how to render particular part of data in Flutter CartesianChart. 

You can refer to our Flutter CartesianChart feature tour page to learn about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our Flatter CartesianChart example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!




Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied