2 charts linking/zoom sync
Is there some method to synchronize gesture zoom of 2 charts with same x length? Say user zooms first chart and the second is zoomed on the same manner?
Hi Igor,
Please see my answer to your question on StackOverflow:
In short, you would need to adapt/implement your own OnChartGestureListener to co-ordinate between the charts.
http://stackoverflow.com/a/41460255/5241933
Dear @drawers
Yes, I thought about gesture listener. Something like
public void onChartScale(MotionEvent me, float scaleX, float scaleY){
oscChart.zoom(scaleX,scaleY, x, y);
}
The cuestión is how to find x, y which are coordinates of the center of translation. Will see.
I managed with zoom center getting fingers' coords in onChartScale method of gesture listener.
@Override
public void onChartScale(MotionEvent me, float scaleX, float scaleY) {
float xPos = (me.getX(0)+me.getX(1))/2f, yPos = (me.getY(0)+me.getY(1))/2f;
chart2.fitScreen();
chart2.zoom(scaleX,scaleY, xPos, yPos);
}