@Override protected void initExample() { final DefaultLayoutManager layoutManager = new DefaultLayoutManager.Builder().setRightOuterAxesLayoutStrategy(new RightAlignedOuterVerticallyStackedYAxisLayoutStrategy()).build(); surface.setLayoutManager(layoutManager); final CategoryDateAxis xAxis = sciChartBuilder.newCategoryDateAxis().withGrowBy(0, 0.05).build(); surface.getXAxes().add(xAxis); final PriceSeries priceData = DataManager.getInstance().getPriceDataEurUsd(getActivity()); final PricePaneModel pricePaneModel = new PricePaneModel(sciChartBuilder, priceData); final MacdPaneModel macdPaneModel = new MacdPaneModel(sciChartBuilder, priceData); final RsiPaneModel rsiPaneModel = new RsiPaneModel(sciChartBuilder, priceData); final VolumePaneModel volumePaneModel = new VolumePaneModel(sciChartBuilder, priceData); addModel(pricePaneModel); addModel(macdPaneModel); addModel(rsiPaneModel); addModel(volumePaneModel); surface.getChartModifiers().add(sciChartBuilder .newModifierGroup() .withXAxisDragModifier().withReceiveHandledEvents(true).withDragMode(AxisDragModifierBase.AxisDragMode.Pan).withClipModeX(ClipMode.StretchAtExtents).build() .withPinchZoomModifier().withReceiveHandledEvents(true).withXyDirection(Direction2D.XDirection).build() .withZoomPanModifier().withReceiveHandledEvents(true).build() .withZoomExtentsModifier().withReceiveHandledEvents(true).build() .withLegendModifier().withShowCheckBoxes(false).build() .build()); }
private void initChart(SciChartSurface surface, BasePaneModel model, boolean isMainPane) { final CategoryDateAxis xAxis = sciChartBuilder.newCategoryDateAxis() .withVisibility(isMainPane ? View.VISIBLE : View.GONE) .withVisibleRange(sharedXRange) .withGrowBy(0, 0.05) .build(); surface.getXAxes().add(xAxis); surface.getYAxes().add(model.yAxis); surface.getRenderableSeries().addAll(model.renderableSeries); surface.getChartModifiers().add(sciChartBuilder .newModifierGroup() .withXAxisDragModifier().withReceiveHandledEvents(true).withDragMode(AxisDragModifierBase.AxisDragMode.Pan).withClipModeX(ClipMode.StretchAtExtents).build() .withPinchZoomModifier().withReceiveHandledEvents(true).withXyDirection(Direction2D.XDirection).build() .withZoomPanModifier().withReceiveHandledEvents(true).build() .withZoomExtentsModifier().withReceiveHandledEvents(true).build() .withLegendModifier().withShowCheckBoxes(false).build() .build()); surface.setAnnotations(model.annotations); verticalGroup.addSurfaceToGroup(surface); }