@Override public void run() { Collections.addAll(surface.getXAxes(), xAxis); Collections.addAll(surface.getYAxes(), yAxis); Collections.addAll(surface.getRenderableSeries(), rs1, rs2, rs3); Collections.addAll(surface.getChartModifiers(), sciChartBuilder.newModifierGroup() .withPinchZoomModifier().withReceiveHandledEvents(true).build() .withZoomPanModifier().withReceiveHandledEvents(true).build() .withZoomExtentsModifier().build() .build()); sciChartBuilder.newAnimator(rs1).withWaveTransformation().withInterpolator(new DecelerateInterpolator()).withDuration(2000).withStartDelay(350).start(); sciChartBuilder.newAnimator(rs2).withWaveTransformation().withInterpolator(new DecelerateInterpolator()).withDuration(2000).withStartDelay(350).start(); sciChartBuilder.newAnimator(rs3).withWaveTransformation().withInterpolator(new DecelerateInterpolator()).withDuration(2000).withStartDelay(350).start(); } });
.withPinchZoomModifier().withReceiveHandledEvents(true).build() .withZoomPanModifier().withReceiveHandledEvents(true).build() .build();
.withPinchZoomModifier().withReceiveHandledEvents(true).build() .withZoomPanModifier().withReceiveHandledEvents(true).build() .build();
.withZoomExtentsModifier().withReceiveHandledEvents(true).build() .withZoomPanModifier().withReceiveHandledEvents(true).build() .withPinchZoomModifier().withReceiveHandledEvents(true).build() .withCursorModifier().withReceiveHandledEvents(true).build() .build();
@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); }