I have a screen with several chartviews on it.
What I need is to when user scrolls/zooms one chart, other charts scroll and zoom also.
I know that on IOS, you can set a scale and translate listener and use refreshWithNewMatrix method to update all views with new scroll/zoom data. But on Android I tried to set ChartGestureListener and invoke this method in onChartScale and onChartTranslate but it only returned my views (that I need to scroll/scale programmatically) to fitscreen.
Please, tell if this feature is supported on Android? Or maybe there is a better way to do this?
In your onChartScale callback, why don't you retrieve the scale/scroll as:
float scaleX = chart.getScaleX();
float scaleY = chart.getScaleY();
float xValue = chart.getViewPortHandler().getContentCenter().x;
float yValue = chart.getViewPortHandler().getContentCenter().y;
and then set the scale/scroll on your other charts using:
otherchart.getViewPortHandler().setZoom( scaleX, scaleY, xValue, yValue );
But seriously, this sort of question belongs to stackoverflow and not here.
@lanitahedgehog, take a look around
http://stackoverflow.com/questions/28521004/mpandroidchart-have-one-graph-mirror-the-zoom-swipes-on-a-sister-graph
Most helpful comment
@lanitahedgehog, take a look around
http://stackoverflow.com/questions/28521004/mpandroidchart-have-one-graph-mirror-the-zoom-swipes-on-a-sister-graph