MPAndroidChart icon indicating copy to clipboard operation
MPAndroidChart copied to clipboard

How to get zoomed chart width?

Open pesiik opened this issue 5 years ago • 1 comments

I want the width of my view to be equal to the real line chart width (with zoom). I set visible x range. And try to get width with many ways. I tried:

chartBitmap.width * scaleX.toInt() and

viewPortHandler.contentWidth() * scaleX.toInt() and

val coefficient = xChartMax / visibleXRange val chartWidth = resources.displayMetrics.widthPixels * coefficient

But I can't make my horizontal scroll bar content width to be equal with my line chart witdh. How can I do this trick?

PS: Cant't upload image. You can see it in my question on stackoverflow: https://stackoverflow.com/questions/64317308/mpandroidchart-how-to-get-zoomed-chart-width

pesiik avatar Oct 13 '20 09:10 pesiik

@pesiik did you find a way to achieve this?

flaviosuardi avatar Jun 30 '25 07:06 flaviosuardi