MPAndroidChart: How to get zoomed chart width?

Viewed 105

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 (red box) to be equal with my line chart witdh:

chart

How can I do this?

0 Answers
Related