final FastBandRenderableSeries projectedVar3 = sciChartBuilder.newBandSeries().withDataSeries(var3DataSeries).withStrokeY1Style(ColorUtil.Transparent).withStrokeStyle(ColorUtil.Transparent).build(); final FastBandRenderableSeries projectedVar2 = sciChartBuilder.newBandSeries().withDataSeries(var2DataSeries).withStrokeY1Style(ColorUtil.Transparent).withStrokeStyle(ColorUtil.Transparent).build(); final FastBandRenderableSeries projectedVar = sciChartBuilder.newBandSeries().withDataSeries(var1DataSeries).withStrokeY1Style(ColorUtil.Transparent).withStrokeStyle(ColorUtil.Transparent).build(); final FastLineRenderableSeries lineSeries = sciChartBuilder.newLineSeries().withDataSeries(actualDataSeries).withStrokeStyle(ColorUtil.Red, 1f).build();
public MacdPaneModel(SciChartBuilder builder, PriceSeries prices) { super(builder, MACD, "0.00", false); final MovingAverage.MacdPoints macdPoints = MovingAverage.macd(prices.getCloseData(), 12, 25, 9); final XyDataSeries<Date, Double> histogramDataSeries = builder.newXyDataSeries(Date.class, Double.class).withSeriesName("Histogram").build(); histogramDataSeries.append(prices.getDateData(), macdPoints.divergenceValues); addRenderableSeries(builder.newColumnSeries().withDataSeries(histogramDataSeries).withYAxisId(MACD).build()); final XyyDataSeries<Date, Double> macdDataSeries = builder.newXyyDataSeries(Date.class, Double.class).withSeriesName("MACD").build(); macdDataSeries.append(prices.getDateData(), macdPoints.macdValues, macdPoints.signalValues); addRenderableSeries(builder.newBandSeries().withDataSeries(macdDataSeries).withYAxisId(MACD).build()); Collections.addAll(annotations, builder.newAxisMarkerAnnotation().withY1(histogramDataSeries.getYValues().get(histogramDataSeries.getCount() - 1)).withYAxisId(MACD).build(), builder.newAxisMarkerAnnotation().withY1(macdDataSeries.getYValues().get(macdDataSeries.getCount() - 1)).withYAxisId(MACD).build()); } }
public MacdPaneModel(SciChartBuilder builder, PriceSeries prices) { super(builder, MACD, "0.00", false); final MovingAverage.MacdPoints macdPoints = MovingAverage.macd(prices.getCloseData(), 12, 25, 9); final XyDataSeries<Date, Double> histogramDataSeries = builder.newXyDataSeries(Date.class, Double.class).withSeriesName("Histogram").build(); histogramDataSeries.append(prices.getDateData(), macdPoints.divergenceValues); addRenderableSeries(builder.newColumnSeries().withDataSeries(histogramDataSeries).withYAxisId(MACD).build()); final XyyDataSeries<Date, Double> macdDataSeries = builder.newXyyDataSeries(Date.class, Double.class).withSeriesName("MACD").build(); macdDataSeries.append(prices.getDateData(), macdPoints.macdValues, macdPoints.signalValues); addRenderableSeries(builder.newBandSeries().withDataSeries(macdDataSeries).withYAxisId(MACD).build()); Collections.addAll(annotations, builder.newAxisMarkerAnnotation().withY1(histogramDataSeries.getYValues().get(histogramDataSeries.getCount() - 1)).withYAxisId(MACD).build(), builder.newAxisMarkerAnnotation().withY1(macdDataSeries.getYValues().get(macdDataSeries.getCount() - 1)).withYAxisId(MACD).build()); } }
@Override protected void initExample() { final IAxis xAxis = sciChartBuilder.newNumericAxis().withVisibleRange(1.1, 2.7).build(); final IAxis yAxis = sciChartBuilder.newNumericAxis().withGrowBy(0.1, 0.1).build(); final DoubleSeries data = DataManager.getInstance().getDampedSinewave(1.0, 0.01, 1000, 10); final DoubleSeries moreData = DataManager.getInstance().getDampedSinewave(1.0, 0.005, 1000, 12); final XyyDataSeries<Double, Double> dataSeries = sciChartBuilder.newXyyDataSeries(Double.class, Double.class).build(); dataSeries.append(data.xValues, data.yValues, moreData.yValues); final FastBandRenderableSeries rSeries = sciChartBuilder.newBandSeries() .withDataSeries(dataSeries) .withFillColor(0x33279B27).withFillY1Color(0x33FF1919) .withStrokeStyle(0xFFFF1919, 1f, true).withStrokeY1Style(0xFF279B27, 1f, true) .build(); UpdateSuspender.using(surface, new Runnable() { @Override public void run() { Collections.addAll(surface.getXAxes(), xAxis); Collections.addAll(surface.getYAxes(), yAxis); Collections.addAll(surface.getRenderableSeries(), rSeries); Collections.addAll(surface.getChartModifiers(), sciChartBuilder.newModifierGroupWithDefaultModifiers().build()); sciChartBuilder.newAnimator(rSeries).withScaleTransformation().withInterpolator(new EasingInterpolator(Ease.ELASTIC_OUT)).withDuration(3000).withStartDelay(350).start(); } }); } }
dataSeries.append(data.xValues, data.yValues, moreData.yValues); final FastBandRenderableSeries rSeries = sciChartBuilder.newBandSeries() .withDataSeries(dataSeries) .withIsDigitalLine(true)
break; case BAND: rSeries = initXyySeries(sciChartBuilder.newBandSeries().build()); break; case OHLC: