Search code examples
androidzoomingmpandroidchart

How to reset the zoom level in MPAndroidChart?


I am using MPAndroidChart, how I can reset the zoom? For example:

1. User make zoomming in the chart
2. User click one button to reset the zoom (back to the default zoom)


Solution

  • You can reset the zoom by calling chart.fitScreen(). This will reset the chart viewport to it's original state (fully zoomed out).