in IOS SDK there are SCIAxisRangeSyncronization and SCIAxisAreaSizeSyncronization for dealing with axis sync. I would like to ask are there any similar classes in Android to do this ? Thanks.
- Ray Hung asked 8 years ago
- You must login to post comments
Hi Ray,
You can synchronize VisibleRange by setting same IRange instance for all your axes. Please take a look on Sync Multiple Charts example. There you can see code like this which does this:
private IRange sharedXRange = new DoubleRange(0d, 1d);
final NumericAxis xAxis0 = sciChartBuilder.newNumericAxis()
.withVisibleRange(sharedXRange)
.build();
final NumericAxis xAxis1 = sciChartBuilder.newNumericAxis()
.withVisibleRange(sharedXRange)
.build();
To synchronize axes sizes you can use SciChartVerticalGroup class but for it supports only synchronization of vertically placed axes. Please take a look on Multi-Pane Stock Charts example. There you can see code like this which adds 4 surfaces into on vertical group which synchronizes size of vertical axes ( in our case all yAxes on the right side ):
private final SciChartVerticalGroup verticalGroup = new SciChartVerticalGroup();
initChart(priceChart, pricePaneModel, true);
initChart(macdChart, macdPaneModel, false);
initChart(rsiChart, rsiPaneModel, false);
initChart(volumeChart, volumePaneModel, false);
private void initChart(SciChartSurface surface, BasePaneModel model, boolean isMainPane) {
...
verticalGroup.addSurfaceToGroup(surface);
}
Hope this will help you!
Best regards,
Yura
- Yura Khariton answered 8 years ago
- You must login to post comments
Please login first to submit.