MPAndroidChart icon indicating copy to clipboard operation
MPAndroidChart copied to clipboard

cannot reset zoom

Open githubArdhy opened this issue 7 years ago • 2 comments

null string on iaxisvalueformatter

barChart.resetZoom(); not works so i cannot see x Axis as seen on the picture.

what should i do

githubArdhy avatar Dec 10 '18 02:12 githubArdhy

chart.fitScreen(); This func can reset zoom. /** * Resets all zooming and dragging and makes the chart fit exactly it's * bounds. */ public void fitScreen() { Matrix save = mFitScreenMatrixBuffer; mViewPortHandler.fitScreen(save); mViewPortHandler.refresh(save, this, false);

    calculateOffsets();
    postInvalidate();
}

y4233640 avatar Apr 02 '19 08:04 y4233640

barChart.post { fitScreen() centerViewTo(0f, 0f, YAxis.AxisDependency.LEFT)
invalidate() }

This will work. I guess this has something to do how the chart renders and the render cycle of the view.

sarthakgandhi1692 avatar Oct 10 '24 10:10 sarthakgandhi1692