sonorangoose
sonorangoose

Reputation: 201

Sync scale & translation of 2 charts in MPAndroidChart

I am using MPAndroidChart and I have multiple LineCharts in a RecyclerView. When the user zooms or pans one chart, I would like the others to update to the same zoom / pan setting. I looked at ViewPortHandler and OnChartGestureListener but the solution wasn't obvious to me.

Thanks

Upvotes: 3

Views: 601

Answers (1)

Philipp Jahoda
Philipp Jahoda

Reputation: 51421

OnChartGestureListener is the way to go.

Just update the scale / zoom / translate state of the other charts according to the values returned from the listener.

More on that here.

Upvotes: 3

Related Questions